CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8

Thread: just for info

  1. #1
    Join Date
    Oct 2010
    Posts
    98

    Question just for info

    hi all,

    Can anyone tell me the difference between using directive and using declaration? (with syntax as an example)





    thanks!!!

  2. #2
    Join Date
    Jan 2006
    Location
    Singapore
    Posts
    6,765

    Re: just for info

    A using directive:
    Code:
    using namespace std;
    A using declaration:
    Code:
    using std::cout;
    C + C++ Compiler: MinGW port of GCC
    Build + Version Control System: SCons + Bazaar

    Look up a C/C++ Reference and learn How To Ask Questions The Smart Way
    Kindly rate my posts if you found them useful

  3. #3
    Join Date
    Oct 2010
    Posts
    98

    Re: just for info

    thanks laserlight
    but every time, it confuses me, what are those #define statements are?? i mean in what sense does it called and used for?

  4. #4
    Join Date
    Jan 2009
    Posts
    1,689

    Re: just for info

    I call those preprocessor directives, as does gcc

  5. #5
    Join Date
    Oct 2010
    Posts
    98

    Re: just for info

    ok,
    i want to ask another question and is: a class is basically, a data type that user defines then when a a variable is declared with some data type. So, what would be the difference? how to define a class?

    thanks

  6. #6
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: just for info

    Quote Originally Posted by Aashi View Post
    what would be the difference?
    The difference between what? using statements and classes? #defines and classes? All three of those are totally unrelated things. There isn't really a comparison to be drawn.

    It's like asking what's the difference between the color yellow and a cement truck.

  7. #7
    Join Date
    Jan 2006
    Location
    Singapore
    Posts
    6,765

    Re: just for info

    Quote Originally Posted by Aashi
    i want to ask another question and is: a class is basically, a data type that user defines then when a a variable is declared with some data type. So, what would be the difference?
    Sorry, I don't understand your question.

    Quote Originally Posted by Aashi
    how to define a class?
    You gave such an example yourself in this thread: access private data members.
    C + C++ Compiler: MinGW port of GCC
    Build + Version Control System: SCons + Bazaar

    Look up a C/C++ Reference and learn How To Ask Questions The Smart Way
    Kindly rate my posts if you found them useful

  8. #8
    Join Date
    Oct 2010
    Posts
    68

    Re: just for info

    Quote Originally Posted by lindley View Post
    it's like asking what's the difference between the color yellow and a cement truck.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured