Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

getting started

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
hello i am new to C++ and I am trying to get started. I have down loaded borland 5.5 and I need to find something to show me how to get the complier started to complie. Is there a good book that I can use or can some one write me up a list of details on how to get a program to complie. I have found some good stater tutorials to get me going in C++ but I need to know what word process to use and how to name the files for complilation ect. pls help
 
I need to know what word process to use and how to name the files for complilation ect. pls help

This is the easy part. Any word processor that can create a text file will do for starters. WordPad, NotePad, ect will work just fine. Just be certain that you create or save the file in text format that will be readable by any program. Don't save the file in "Word" format or something like it that can only be read by Word, etc.

Later, you want to invest in a "true" editor. (I prefer Multi-Edit ;-) .) You can buy these or download demos, shareware, or freeware. Editors will have allow you to do things like syntax highlighting where C/C++ resevered words are highlighted. They can also automatically fill in blocks, find files, view files in hex mode, etc. NOTE: Asking which editor is best has been known to ignite religious wars. Everybody has their own favorite. The only who can determine which editor is best is you.

Your uncompiled programs, the ones created by the word processor or editor, can have any name as long as the extention is CPP. For example, MyFilePrgm.cpp, Hello.cpp, ThisRocks.cpp, etc. The reason is some compilers and most people look at the extention to determine the type of file it is. Files that end in C are expected to be C language files. Files that end in H are expected to he header files.

For example, open your editor/word processor and type the following in:
Code:
#include <stdio.h>

int main(void)
{
    printf(&quot;Hi there, World!&quot;);
    return 0;
}

Save this file as HiWorld.cpp making certain it is in text format. Assuming that your Borland programs reside on your D drive in the Borland\bcc55 directory, you can compile this like:
Code:
bcc32 -ld:\Borland\bcc55\include -Ld:\Borland\bcc55\Lib hiworld.cpp

This should create a file named hiworld.exe. Running this program will show &quot;Hi there, World!&quot;. Bcc32 is the command line processor. -l (lowercase ell, not the number one) tells processor to use the &quot;include&quot; libraries in the &quot;D:\Borland\bcc55\include&quot; directory. -L tells the compile the other libraires in the &quot;d:\Borland\bcc55\Lib&quot; directory. Hiworld.cpp is the program you wrote.

I would suggest that you go to community.borland.com and join the community. It's free! You can then search for article like &quot;How do I install the Borland 5.5 compiler and command line tools.&quot; This article will also show you what command line option you have available and some examples on how to compile.
James P. Cottingham
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top