Thread: Future for C programming in Windows?

  1. #1
    Registered User
    Join Date
    May 2003
    Posts
    2

    Future for C programming in Windows?

    I've got a little experience with C from college. I'm just getting interested in writing windows app's. Where does C fit in with windows? Can you code programs in C using Visual Studio .NET?
    How difficult would it be to switch to C++? Thanks in advance for everyone's advice.

  2. #2
    Cat
    Guest
    Well, you can write any windows program using only C -- the windows API was designed like that. It would probably be wiser to look into C++, though, as windows programming really benefits from the object-oriented nature of C++. They are wrapper classes like MFC which make some of the details easier, although it's a good idea to know what's going on under the hood.

  3. #3
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    C/C++ is and will be the foundation of Windows OS. Stay with C/C++ and you will be fine.

    Kuphryn
    Last edited by kuphryn; 05-19-2003 at 09:04 AM.

  4. #4
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    The switch from C to basic C++ is easy, but you'll have to unlearn some C habits.
    More advanced C++ comes with time.
    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

  5. #5
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    MS really advocates the use of C and C++ for writing programs. Though C++ is pretty much becoming the standard since many of the features of Windows programming are really meant for C++ (like COM and OLE just to name a few). But C still has its place. Hell I still use a fair amount of assembler for windows programming.

  6. #6
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398

    C is a sub-set of C++

    Because C++ is (mostly) a subset of C++, you CAN compile C programs with Visual Studio, and most of the time the compiler won't know, or care!

    Charles Petzold's book "Programming Windows" uses C. It isn't necessary to use C++ to access the Windows API, and Petzold uses fairly simple program examples. His examples are not short... there is a lot of "overhead" for windows programs... but the program flow/logic/algorithms are not complex.

    I do recommend Petzold's book, and here's a link to a Windows Tutorial

  7. #7
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    Ah, I wouldn't call it that. Especially since C99.

    The compiler DOES know and DOES care. A great deal. It decides on file endings: c is compiled as C code, cpp and cc as C++ code. Two different parts of the compiler are invoked, and trust me, they do differ.
    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

  8. #8
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    >>>
    The compiler DOES know and DOES care. A great deal. It decides on file endings: c is compiled as C code, cpp and cc as C++ code. Two different parts of the compiler are invoked, and trust me, they do differ.
    <<<

    However, if you open a C++ file, (i.e. with a .cpp extension), and write C in it, the complier will compile it.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  9. #9
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    Are you sure?

    If you open a cpp file and write pure and old C in it (look at the zlib source for examples) then the compiler will not compile it unless it's inside extern "C" braces.
    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. Just starting Windows Programming, School me!
    By Shamino in forum Windows Programming
    Replies: 17
    Last Post: 02-22-2008, 08:14 AM
  2. how to make a windows application
    By crvenkapa in forum C++ Programming
    Replies: 3
    Last Post: 03-26-2007, 09:59 AM
  3. Script errors - bool unrecognized and struct issues
    By ulillillia in forum Windows Programming
    Replies: 10
    Last Post: 12-18-2006, 04:44 AM
  4. Question..
    By pode in forum Windows Programming
    Replies: 12
    Last Post: 12-19-2004, 07:05 PM
  5. Manipulating the Windows Clipboard
    By Johno in forum Windows Programming
    Replies: 2
    Last Post: 10-01-2002, 09:37 AM