5 Replies - 438 Views - Last Post: 31 July 2014 - 07:51 AM Rate Topic: -----

#1 michaelcollins01  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 31-July 14

C or C++ ?

Posted 31 July 2014 - 02:50 AM

I am new to the world of programming and I'd like to write and compile code using MS Visual Studio Express 2013.

I have been told that learning to code in C is the best way to get started, as it is the foundation for most modern programming languages.

However, is MS Visual Studio 2013, I don't see an option for setting up a project for the C programming language, only C++ and C#.

Should I write and compile in a C++ programming environment instead of C? or do I really need to start with C. Do I need another program, or is there some sort of option/tool in MSVSE 2013 that I'm missing?

Is This A Good Question/Topic? 0
  • +

Replies To: C or C++ ?

#2 andrewsw  Icon User is offline

  • It's just been revoked!
  • member icon

Reputation: 3806
  • View blog
  • Posts: 13,500
  • Joined: 12-December 12

Re: C or C++ ?

Posted 31 July 2014 - 03:24 AM

There are some instructions here to run C programs in VS. I haven't tried it myself, and there are other ways to approach this I believe.

I will leave advice about whether to start with C to someone else.
Was This Post Helpful? 0
  • +
  • -

#3 Deepak_Patil  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 01-July 14

Re: C or C++ ?

Posted 31 July 2014 - 05:03 AM

You can set up, write and compile C programs in C++ environment as all C programs can run in it.
Or you can follow the instructions given by andrew.

Another thing for compiler is, you can think about gcc if you have plan to work in Linux in future. It works same for Windows as well as Linux. You get it from, My link

Regarding language selection you have taken right step by choosing C!
Was This Post Helpful? 0
  • +
  • -

#4 Skydiver  Icon User is online

  • Code herder
  • member icon

Reputation: 3662
  • View blog
  • Posts: 11,465
  • Joined: 05-May 12

Re: C or C++ ?

Posted 31 July 2014 - 05:58 AM

Be warned that Visual Studio's support for C is for a very old C standard: C89 -- and it isn't even compliant at that. Most of the C code you'll encounter nowadays will be using at least the C99 standard, and you will will run into issues. I recommend using Code::Blocks if you want to write pure C code.

As for choosing between C or C++. I suggest neither. Pick Python, Java, or C# first to learn basic programming concepts at a higher level abstracted away from the nitty gritty details of the machine and how it deals with memory, how code is compiled, etc.
Was This Post Helpful? 1
  • +
  • -

#5 baavgai  Icon User is offline

  • Dreaming Coder
  • member icon

Reputation: 5929
  • View blog
  • Posts: 12,851
  • Joined: 16-October 07

Re: C or C++ ?

Posted 31 July 2014 - 06:08 AM

andrewsw's link is good, but it is incomplete. There is a final step.

Under Config > C/C++ > Advanced > Compile As, set it to Compile as C code. Compiling C as C++, while possible, has a number of gotchas. ( You can also, sometimes, find this option one level up in Config > C/C++ > Compile As. )

While you're at it, under General > Character Set. This will default to Unicode, which is fine for a new project. However, some programs will have holy fits with this, including some windows programs. Use "No Set" until you know what you need.

If you have Windows, VS is one of the best tools for C development. If you're honest and use only C and portable libraries, you should be able to compile it anywhere.

Hope this helps.
Was This Post Helpful? 0
  • +
  • -

#6 Skydiver  Icon User is online

  • Code herder
  • member icon

Reputation: 3662
  • View blog
  • Posts: 11,465
  • Joined: 05-May 12

Re: C or C++ ?

Posted 31 July 2014 - 07:51 AM

View Postbaavgai, on 31 July 2014 - 09:08 AM, said:

If you have Windows, VS is one of the best tools for C development. If you're honest and use only C and portable libraries, you should be able to compile it anywhere.

In my opinion, VS is one of the best tools for debugging C code in a Windows environment. The debugger in the IDE is top notch. :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1