Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 void main() error
Index -> Programming, C++ -> C++ Help
Goto page Previous  1, 2
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
OneOffDriveByPoster




PostPosted: Fri Dec 19, 2008 10:30 am   Post subject: Re: RE:void main() error

wtd @ Fri Dec 19, 2008 2:18 am wrote:
use endl.
endl << endl is just bad. That should have one '\n' and one endl.
Sponsor
Sponsor
Sponsor
sponsor
Dan




PostPosted: Fri Dec 19, 2008 5:29 pm   Post subject: RE:void main() error

endl != '\n'

On some OSs the line break is just '\n' such as most *nix based ones. However on windows it is "\r\n" and on some very old mac OSs it is just '\r'.
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
romantic_programmer




PostPosted: Fri Dec 19, 2008 5:55 pm   Post subject: RE:void main() error

DAN i just made a break through... I got my code to compile. Yay!

I Got rid of the DEV editor then just went back to basics...

now i am running the crimsion editor and the minGW compiler.

it took me a few attempts to compile the work but this is what i type and it works

c++ Main.cpp -o AzureGale.exe

Now i was wondering if someone could explain to me that the -o part means... i think it means output but i not sure
wtd




PostPosted: Fri Dec 19, 2008 6:08 pm   Post subject: RE:void main() error

Essentially, yes. It provides an output file name.

When in doubt, "gcc --help" is your friend.
OneOffDriveByPoster




PostPosted: Sat Dec 20, 2008 8:24 am   Post subject: Re: RE:void main() error

Dan @ Fri Dec 19, 2008 5:29 pm wrote:
endl != '\n'

On some OSs the line break is just '\n' such as most *nix based ones. However on windows it is "\r\n" and on some very old mac OSs it is just '\r'.
The '\n' when printed to a text-stream produces the correct end-of-line character sequence. The difference between using '\n' and endl is elsewhere.
Display posts from previous:   
   Index -> Programming, C++ -> C++ Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 2 of 2  [ 20 Posts ]
Goto page Previous  1, 2
Jump to:   


Style:  
Search: