c++ to C

This is a discussion on c++ to C within the C Programming forums, part of the General Programming Boards category; Is it possible to convert c++ to C by just changing the variables? or must i write the entire thing ...

  1. #1
    Rah
    Guest

    c++ to C

    Is it possible to convert c++ to C by just changing the variables? or must i write the entire thing over :X

  2. #2
    Registered User Vber's Avatar
    Join Date
    Nov 2002
    Posts
    807
    I don't know any tools for doing this, but as far as I know, in C++ you have classes, constructors and so on... in C you don't have it. So if your code uses class, it wont be a valid C code, just changing the variables.

  3. #3
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Originally posted by Vber
    I don't know any tools for doing this, but as far as I know, in C++ you have classes, constructors and so on... in C you don't have it. So if your code uses class, it wont be a valid C code, just changing the variables.
    Not to mention things like templating, operator overloading, etc etc. Theoreticly, you could do the same in C, but it'd be a real pain.

    In such a case, you'd be best served using the C++ code as a guide and just rewrite the whole thing.

    Quzah.
    Hope is the first step on the road to disappointment.

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