How can I just write C code with MS Visual C++

This is a discussion on How can I just write C code with MS Visual C++ within the C++ Programming forums, part of the General Programming Boards category; Is this possible?
I'm new to programming, and would like to learn C, before I start learning about objects etc.
...

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.

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.

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.

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.

Also, please do not recommend one IDE/compiler over the other if you have never even used one of them. Stupid thing to do.

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.

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. 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.

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.

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.

So, given that, SUGGESTING a different compiler in this circumstance is r e t a r d e d.

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.

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.