Good C site for C++ programmer
-
I'm working on a C project, but all my experience is with C++. Any recommendations for a good C website? Preferably with a good, active community like CodeProject's for questions I might have. Thanks
Mark J. Miller wrote:
Any recommendations for a good C website?
I'm a pretty avid C programmer myself and I tend to find a lot of use out of CP still. Granted. I can never use much code from most articles as is (not that I would anyway), but the concepts are generally translatable. What in particular are you after? The C way of life? Differences between C and C++ (like how myFunc(void) is interpreted differently between the two for instance), etc.? Actually, if you're used to C++ I think it'll benefit you in a procedural world. I think employing some OOP concepts in C (within reason) is a better way of going about things than most traditional procedural texts bother to teach (they never focus on design IMO).
Jeremy Falcon Oatmeal, It's What's for Dinner.[^]
-
I'm working on a C project, but all my experience is with C++. Any recommendations for a good C website? Preferably with a good, active community like CodeProject's for questions I might have. Thanks
Mark J. Miller wrote:
Any recommendations for a good C website?
What's wrong with this one? If you are already familar with C++, then there's very little about C that will surprise you.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
Mark J. Miller wrote:
Any recommendations for a good C website?
I'm a pretty avid C programmer myself and I tend to find a lot of use out of CP still. Granted. I can never use much code from most articles as is (not that I would anyway), but the concepts are generally translatable. What in particular are you after? The C way of life? Differences between C and C++ (like how myFunc(void) is interpreted differently between the two for instance), etc.? Actually, if you're used to C++ I think it'll benefit you in a procedural world. I think employing some OOP concepts in C (within reason) is a better way of going about things than most traditional procedural texts bother to teach (they never focus on design IMO).
Jeremy Falcon Oatmeal, It's What's for Dinner.[^]
I have a school project which includes part of the code already written in C. I either need to translate what has been written into C++ or I need a good reference which can tell me how to do in C what I already know in C++.
-
I have a school project which includes part of the code already written in C. I either need to translate what has been written into C++ or I need a good reference which can tell me how to do in C what I already know in C++.
I have found on several occasions that doing even a simplistic ( one file == one class ) port of C code to C++ has helped me to understand the code much better than any amount of time spent simply reading it. There are also numerous potential advantages in porting the code from spotting bugs to taking advantage of newer technologies. There's always the risk of introducing new bugs of course but most of this can be offset by being able to test in direct comparison to the original code. If it was me I'd probably C++ the code as straight forwardly as possible, make it work, and then look at ways to improve it if the schedule allowed.
Nothing is exactly what it seems but everything with seems can be unpicked.
-
I have a school project which includes part of the code already written in C. I either need to translate what has been written into C++ or I need a good reference which can tell me how to do in C what I already know in C++.
Mark J. Miller wrote:
I either need to translate what has been written into C++ or I need a good reference which can tell me how to do in C what I already know in C++.
Actually, you're in luck, one of the design goals of C++ was to be able to compile C code. However, if the program wasn't written with some OOP principles (like treating a file.c as a class, etc.) then a direct port may be an issue. For the most part you'll feel at home in C, but there are a few gotchas along the way. Here's one link for example: http://people.cs.uchicago.edu/~iancooke/osstuff/ccc.html[^]
Jeremy Falcon Oatmeal, It's What's for Dinner.[^]
-
I'm working on a C project, but all my experience is with C++. Any recommendations for a good C website? Preferably with a good, active community like CodeProject's for questions I might have. Thanks
As always I got what I needed. You guys at CP are the best.
-
I'm working on a C project, but all my experience is with C++. Any recommendations for a good C website? Preferably with a good, active community like CodeProject's for questions I might have. Thanks
See http://www.iu.hio.no/~mark/CTutorial/CTutorial.html[^] does any help?
-
I have a school project which includes part of the code already written in C. I either need to translate what has been written into C++ or I need a good reference which can tell me how to do in C what I already know in C++.
I am surprised no one pointed this out. If you want to include C code into a C++ project then wrap the C headers in an
extern “C” {headers here}
block or place the block in the header files themselves (Hint: See the C header file included with C++). As an alternative you can change the names of the C sources files from “.c” to “.cpp” and they will be compiled as C++. Since C++ is a superset of C, they should compile without any problems. There are some differences you need to look out for, but if you do not need to modify the C code it should be ok. If you need to modify the C code, then either use the block method or learn the minor differences (Hint: sizeof works differently in C).INTP "Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
-
Mark J. Miller wrote:
Any recommendations for a good C website?
What's wrong with this one? If you are already familar with C++, then there's very little about C that will surprise you.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
As always I got what I needed. You guys at CP are the best.