C++ tutorial from cplusplus

I am learning C++ from the tutorial and have done the first two chapters.

This will sound idiotic - but how do I run the simple sample programs given therein? I have tried to decipher the vast info in GNU GCC and Borland C++ too...since I dont know anything about anything, I am stuck. I am very familiar with Assembly language of 8051 generics, and am readonably adept at programming in it. C++ too seems not all that difficlt - it is the compiler system that bugs me. Can anyone please help?

Inteleque
I haven't used GNU GCC or Borland C++, so I can't help you with those directly. I've been using Dev-C++ and Visual C++ Express 2008. Both of those are available for free download.

Dev-C++ is about as simple as they come. (At least for single file programs. Whenever I make something big enough that it needs to be broken up into different files, I tend to use Visual C++.) In Dev-C++ there is a 'new source file' button in the toolbar at the top. To get started all you have to do is click that button and start writing your code. Then there is a 'compile and run' button on the toolbar that you just click whenever you're ready.

Visual C++ is slightly more complicated to use, but the Microsoft site that it's available on contains tutorial videos that will show you how to navigate the menus and get started.

Hope this helps.
To get gcc to compile with c++ code, you need the g++ component of the gcc. g++ will contain the c++ standard libraries.

I do not really know where you are stuck at. Are you having problems installing the compilers? or the compilers simply do not want your code? If you can be more specific then help will be more detailed.
Dev-C++ will install and compile your programs for you.

If you just get the GCC you'll have to compile your programs from the command prompt.

For example, say you have "myprog.cpp", which includes "zat.h" to use the stuff in "zat.cpp", you compile with:
g++ -o myprog myprog.cpp zat.cpp
This compiles "myprog.cpp" and "zat.cpp" and links them into an executable named "myprog".

Hope this helps.
Topic archived. No new replies allowed.