Re: c++ confusion

Alix,
I don't know what these "few other lines" intale, but basically, this is how it 
works.
The return statement returns an exit code, 0 means success, anything else means 
failure. You can easily retrieve this from the shell if your on *nix and using 
bash, and work off of the exit code.
Most main statements look like this:
int main(int arg,char** argv)
{
//code here
return 0;
}

If you want to use a command line compiler, I recommend gnu g++, it's the 
easiest to use for command-line stuff.
Visual c++ isn't it's own language as much as it is just an ide; getting used 
to it if your doing windows programming might help though, as the code 
completion and other features it gives you are rather nice.

On Dec 18, 2009, at 4:53 PM, Alex Hall wrote:

> Hi all,
> I may have to learn a lot of c++ or, more specifically, visual c++ sometime 
> soon. I am confused on some things from my limited c++ experience in the past:
> 
> 1. Some compilers want the "return(0) and a few other lines at the end of 
> your main function, while some do not. I have noticed this and similar small 
> differences. What is this all about, and what decides what specific code 
> needs to be included?
> 
> 2. What is visual c++ to regular c++ and is it very different? Can I use my 
> favorite c++ program to compile vc++ or does this language require its own 
> compiler?
> 
> 3. Is there a simple command-line c++ or vc++ compiler I can get so I can use 
> EdSharp instead of a dedicated IDE?
> 
> Thanks for any help!
> 
> 
> Have a great day,
> Alex
> New email address: mehgcap@xxxxxxxxx 
> __________
> View the list's information and change your settings at 
> http://www.freelists.org/list/programmingblind

__________
View the list's information and change your settings at
http://www.freelists.org/list/programmingblind

Other related posts: