Thread: Teach yourself C in Visual C++ 2005 Express

  1. #1
    Registered User
    Join Date
    Oct 2006
    Posts
    1

    Teach yourself C in Visual C++ 2005 Express

    Hello,

    I am trying to learn C using an older version of Sams "Teach Yourself C in 21 Days." I have downloaded and installed the free version of Microsoft's Visual C++ 2005 Express Edition. As any of you with more experience know, the code samples from my book will not work properly in this compiler.

    My question is pretty basic. Is there a setting in the new compiler that will make it function as a simple C compiler, or is there a simple line like "# include stdafx.h" instead of "#include stdio.h" that I can write at the top of the code samples that will allow me to progress with this book and compliler combination?

    It may be that what I am attempting is much more complicated than I am prepared for, in which case I will be willing to try something else, either learm much more about this compiler or get a much simpler one that will work with this book.

    Thanks,

    Avispex

  2. #2
    Registered User
    Join Date
    Jun 2004
    Posts
    277
    If you need something to learn I would recommend CodeBlocks or Dev-C++ those IDE's are much more easy to use and support a more stabdart C than MS products.

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Compilers support languages, not IDE's

    > Is there a setting in the new compiler that will make it function as a simple C compiler
    Not as such.
    - Create a new win32 console project. This will create a default project.cpp file with that stdafx abomination in it.

    - In project->settings->compiler->precompiled headers - choose "do not use precompiled headers". Make sure you get it for both debug and release builds.

    - Then do file->new and create a blank file, then save that as a .c file. Add that to the project.

    You can then remove the project.cpp, stdafx.cpp and stdafx.h from the project.

    In your new blank .c file, just type in your C code.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  4. #4
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    Better idea: when creating a new console project, go to the application settings tab in the new project wizard and check "Empty Project". That's assuming VS.Net 2005 still has that, but it would be outstandingly stupid of MS to have removed it.
    By choosing empty project, all that pollution is not there in the first place.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. We Got _DEBUG Errors
    By Tonto in forum Windows Programming
    Replies: 5
    Last Post: 12-22-2006, 05:45 PM
  2. C++ std routines
    By siavoshkc in forum C++ Programming
    Replies: 33
    Last Post: 07-28-2006, 12:13 AM
  3. load gif into program
    By willc0de4food in forum Windows Programming
    Replies: 14
    Last Post: 01-11-2006, 10:43 AM
  4. Errors with including winsock 2 lib
    By gamingdl'er in forum C++ Programming
    Replies: 3
    Last Post: 12-05-2005, 08:13 PM
  5. Learning OpenGL
    By HQSneaker in forum C++ Programming
    Replies: 7
    Last Post: 08-06-2004, 08:57 AM