CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2008
    Location
    Cologne, Germany
    Posts
    756

    Question How to distinguish between c and c++?

    is there an easy way to distinguish between c and c++? I mean how do I know if a function or a header file is c or c++? is it important at all to be able to tell what is c and what is c++ when I'm going to learn MFC?
    win7 x86, VS 2008 & 2010, C++/CLI, C#, .NET 3.5 & 4.0, VB.NET, VBA... WPF is comming

    remeber to give feedback you think my response deserves recognition? perhaps you may want to click the Rate this post link/button and add to my reputation

    private lessons are not an option so please don't ask for help in private, I won't replay

    if you use Opera and you'd like to have the tab-button functionality for the texteditor take a look at my Opera Tab-UserScirpt; and if you know how to stop firefox from jumping to the next control when you hit tab let me know

  2. #2
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,633

    Re: How to distinguish between c and c++?

    is there an easy way to distinguish between c and c++?
    Yep. The easiest way is to get both studied. After that you're gonna have no questions of this sort. Trust me, it shouldn't take a lot of time, maybe a year or something.

    More unreliable way is asking google.
    Last edited by Igor Vartanov; December 19th, 2010 at 02:15 PM.
    Best regards,
    Igor

  3. #3
    Join Date
    Sep 2004
    Location
    Holland (land of the dope)
    Posts
    4,123

    Re: How to distinguish between c and c++?

    is there an easy way to distinguish between c and c++?
    is it important at all to be able to tell what is c and what is c++ when I'm going to learn MFC?
    By the time you know the answer to the first question, you will already know the answer to the second question. Simply start programming both and you will soon see the differences and the hows and why's.

  4. #4
    Join Date
    Jul 2010
    Posts
    88

    Re: How to distinguish between c and c++?

    C functions without input must have "(void)" as input while C++ have both "()" and "(void)".
    C++ have the keyword "class" because it is almost object oriented (without garbage collecting).

  5. #5
    Join Date
    Apr 1999
    Posts
    27,449

    Re: How to distinguish between c and c++?

    Quote Originally Posted by memeloo View Post
    is there an easy way to distinguish between c and c++?
    Take the sample source file, and change the extension to .c. If it compiles, change the extension to .cpp. If it doesn't compile, then the module was meant to be compiled using a C compiler.

    Regards,

    Paul McKenzie

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