Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

C in Visual Studio

  • 19-09-2009 09:06PM
    #1
    Closed Accounts Posts: 627 ✭✭✭


    Hi Guys,

    I am learning abit of C by myself and have downloaded a trial version of the new professional version of Visual Studio.

    I am trying to write some C Code but am unsure what to do to ensure that I am using Visual Studio correctly. I have googled a bit on it and have tried saving files as .c but Im sure that i am doing something/many thing wrong!!

    Could someone give me a very simplistic (idiot-proof) step by step way to begin writing C in Visual Studio and after writing, how to see if the code works?

    Cheers and thanks in advance


Comments

  • Registered Users, Registered Users 2 Posts: 515 ✭✭✭NeverSayDie


    Along with having files with .c extensions, pretty sure you need to tell it to compile the stuff as C code. Don't have a copy to hand, but I'd take a look under the Project->Properties dialog, somewhere in advanced compiler settings or something like that.


  • Registered Users, Registered Users 2 Posts: 378 ✭✭gagomes


    just use notepad to create your-program.c and then compile it using cl.exe your-program.c

    Watch out if the cl.exe is in the path environment variable.


  • Registered Users, Registered Users 2 Posts: 2,082 ✭✭✭Tobias Greeshman


    Along with having files with .c extensions, pretty sure you need to tell it to compile the stuff as C code. Don't have a copy to hand, but I'd take a look under the Project->Properties dialog, somewhere in advanced compiler settings or something like that.
    Yep think its Advanced tab, there should be a drop down list for "compile code as". Think the /Tp switch says compile as C++ and /Tc compile as C code, so thats the switch you'll want.


Advertisement