Is this possible?
I'm new to programming, and would like to learn C, before I start learning about objects etc.
What is the simplest way to start write in C programs?
Thanks for your help!
Dan
Is this possible?
I'm new to programming, and would like to learn C, before I start learning about objects etc.
What is the simplest way to start write in C programs?
Thanks for your help!
Dan
C++ is kind of like a superset of C. There are cases in which something that is completely valid in C will not compile as C++, and with the advent of namespaces and a change in the conventions for the standard libraries there are many exceptions, but here are some suggestions:
- Just learn C++. You learn most of C along the way anyway.
- Write C code, and then just make the necessary changes to the header files to make it C++ compileable.
- Get a different compiler. The free Dev-C++ from bloodshed.net will let you compile programs as C. MS VC++ might allow you too as well, I've never used it, so check that first. I would've assumed it would.
I believe Visual C++ has an option somewhere that allows you to compile the code as C.
Also, I think if your source file has a .C extension, it treats it as C code automatically.
To the OP, take this "advice" with a grain of salt. If you want to learn C first, go right ahead. Nothing wrong with that at all.Originally Posted by sean_mackrory
To sean: the simple solution to his question is to create files with a .c extension, as Dante said. VC++ automatically creates them with a .cpp extension if no other is specified. Also, please do not recommend one IDE/compiler over the other if you have never even used one of them. Stupid thing to do.
Microsoft's VC++ line of compilers are fine.
Last edited by spoon_; 07-02-2005 at 02:52 PM.
{RTFM, KISS}
Did I recommend one over the other? No, I told him that if VC++ did not do it, Dev-C++ would, but that he needed to check on it first. And I cannot find one sentence in which I said there was anything wrong with learning C first. I merely suggested he might not want to bother if he plans to learn C++ eventually anyway. Don't bring your bad mood onto the board. Stupid thing to do.Also, please do not recommend one IDE/compiler over the other if you have never even used one of them. Stupid thing to do.
And you'll notice that when I said, "I would've assumed it would", my advice is not really dripping with anti-Microsoft disdain, so don't get so defensive. They were "suggestions" for him to look at anyway.
Get a different compiler? Based on what facts?Originally Posted by sean_mackrory
gg
{RTFM, KISS}
FACT: Dev-C++ can compile C code
FACT: He wasn't aware of how to compile C code
MY THOUGHT: If it he can find no way of compiling C code in VC++, he may want to check out Dev-C++.
FACT: You've never used VC++Originally Posted by sean_mackrory
FACT: Recommending one product over another (which you've never used) is......... r e t a r d e d.
{RTFM, KISS}
Show me where I "recommended" Dev-C++ over VC++. I suggested he try a different compiler, sure, but is it not retarted to ignore the fact that I told him to research VC++'s ability to do so before switching, stating clearly that I would be surprised if it didn't.
Apparently, he has a compiler. He does not need to get another one. He had one simple question that you are not qualified to answer.Originally Posted by sean_mackrory
So, given that, SUGGESTING a different compiler in this circumstance is r e t a r d e d.
{RTFM, KISS}
If VC++ does not allow you to compile C code, then he DOES need another compiler. Again, I clearly stated that I would've thought that VC++ would compile C code, and that he would still need to confirm this. Dante did that.He does not need to get another one.
At that point, you brought your bad day on the board and decided to argue with my advice, clearly labelled as "suggestions".
I am closing this thread because it's going nowhere. If the original poster has any further questions or anyone has constructive advice to give, please PM me or another mod who is online and it can be reopened for you. If spoon_ has more problems, he can pm me too.