C to C++

This is a discussion on C to C++ within the C++ Programming forums, part of the General Programming Boards category; I found these great tuts on C sockets, except, i dont know if they'll work in C++ Does anyone know ...

  1. #1
    Flash Animator, OF DOOOOM bluehead's Avatar
    Join Date
    Nov 2001
    Posts
    269

    C to C++

    I found these great tuts on C sockets, except, i dont know if they'll work in C++

    Does anyone know if C programming will work in C++ compilers? Isn't C++ the same as C except just more?

    thanx
    Code:
    #if _emo
      #define stereo_type_i_dislike
    #endif

  2. #2
    Registered User
    Join Date
    Jan 2002
    Posts
    68
    All C should work in any c++ compiler. One of the goals in creating C++ was to retain backwards compatibility. Many argue that that hinders C++ quite a bit. Java was created to fix C++ by creating a language that wasnt restricted by being compatible with C. Me...I like C++ just fine

  3. #3
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,340
    No they are not the same
    http://david.tribble.com/text/cdiffs.htm

    You can call C code from C++ code, by use of the extern "C" feature

    You will see a lot of this if you look through the C standard header files provided with your compiler.

  4. #4
    Banned Troll_King's Avatar
    Join Date
    Oct 2001
    Posts
    1,784
    C++ supports link compatibility with the C language, but in recent standard revisions, C has moved away from C++ toward low level functionality.

    If you want to know all about it read, 'The Design And Evolution Of C++' by Bjarne Stroustrup and also check out the standards organization information(s). I never had time to learn too many of the details. School interferes with learning.

  5. #5
    Registered User
    Join Date
    Jan 2002
    Posts
    68
    Sorry about that...my bad. I don't program in C but from what I've read I got the strong impression that Stroustrup kept them compatible.

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21