New to C++

Status
Not open for further replies.

BlindApex

In Runtime
Messages
297
hey, i'm learning c++ now on my own, and i was wondering if someone could give me a step-by-step guide to saving and compiling code using the ANSI standard C++. What would be the best compiler and how do I use it, I cant seem to run the other ones I have tried

thx
 
Hey, first download the free c++ compiler provided by BORLAND
take there survey and you will be compile in no time. http://www.borland.com/products/downloads/download_cbuilder.html

then to use it read this 3 page article
http://cplus.about.com/library/weekly/aa031502a.htm V 5.5

You migh be interested in Delphi also which is made by Borland, It is a High power alternative to Visual Basic used for making rapid windows programs, it comes with an IDE, which is really stable, solid and, it is based on Pascal, a very strong programming language, while VB is based on a "Basic" programming language.
 
okay, i think i got it working

however, i think my code has some errors in it...

this is what i wrote:

/* Program #1 - A first C++ program.

Enter this program, then compile and run it.
*/

#include <iostream>
using namespace std;

int main()
{
cout << "This is my first C++ program.";

return 0;
}

-----------------------------------------------------------------------

when i try to compile it, i get "*** 3 errors in Compile ***"

Error E2209 c:\mycode\1.cpp 6: Unable to open include file 'iostream'

Error E2282 c:\mycode\1.cpp 7: Namespace name expected

Error E2451 c:\mycode\1.cpp 11: Undefined symbol 'cout' in function main()



I'll keep trying, but any suggestions?
 
First make sure you have setup your environment variables, then put this in the hello.cpp file, i'm using images because i think this forum has a bug, it wont let me type iostream.h

New2.png


to compile goto command type cd c:\Location of your source file (c:\mycode)

then type bcc32 hello.cpp

after it compiles you test it py typing Hello.exe,
you should get the "This is my first c++ program" as an output.

It worked fine for me. any questions let me know.

NewBitmap.png
 
#include = always has some type of library following it.

such as <i o s t r e a m> as you should have typed after it includes functions such as "cout" that you used to display your message.

i spaced the library name because as "sippin" posted the forum has some type of problem when you write it out and doesnt post it.
 
Status
Not open for further replies.
Back
Top Bottom