Thread: C & visual studio 2008

  1. #1
    Registered User
    Join Date
    Apr 2009
    Posts
    4

    C & visual studio 2008

    Is it possible to write, compile, run and debug C programs with Visual Studio 2008? I got it hoping I could use it instead of vim but C isn't on the list of supported languages and I can't find a way to make it work. Can some one please tell me how to use Visual Studio 2008 with C or suggest another (free) IDE for C programming?

    Thanks in advance.

  2. #2
    Registered User hk_mp5kpdw's Avatar
    Join Date
    Jan 2002
    Location
    Northern Virginia/Washington DC Metropolitan Area
    Posts
    3,817
    When you create a project and start adding source files to the project just name them with a .c extension instead of .cpp. When the compiler does it's job it will treat any file with a .c extension as a C source file instead of the default which is C++. There are also ways in which you can tell the IDE to treat a file as C source code even if it does have a .cpp extension ("Project->Properties->Configuration Properties->C/C++->Advanced->Compile As" should be set to "Compile as C code" instead of "Compile as C++ Code"). The rules for compiling C versus C++ are different and the IDE will do the right thing if you choose the proper options.
    "Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
    -Christopher Hitchens

  3. #3
    Registered User
    Join Date
    Apr 2009
    Posts
    4

    Thank You

    It's working now, thank you for you help.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. more then 100errors in header
    By hallo007 in forum Windows Programming
    Replies: 20
    Last Post: 05-13-2007, 08:26 AM
  2. We Got _DEBUG Errors
    By Tonto in forum Windows Programming
    Replies: 5
    Last Post: 12-22-2006, 05:45 PM
  3. C++ std routines
    By siavoshkc in forum C++ Programming
    Replies: 33
    Last Post: 07-28-2006, 12:13 AM
  4. load gif into program
    By willc0de4food in forum Windows Programming
    Replies: 14
    Last Post: 01-11-2006, 10:43 AM
  5. Learning OpenGL
    By HQSneaker in forum C++ Programming
    Replies: 7
    Last Post: 08-06-2004, 08:57 AM