Dev-cpp compiler

Programming Reality Factory and Genesis3D.
Post Reply
User avatar
jonas
Posts: 779
Joined: Tue Jul 05, 2005 5:43 pm
Location: Texas, USA
Contact:

Dev-cpp compiler

Post by jonas »

When I try to make a command prompt program in Dev-cpp the command end1; doesn't work! Does anyone know why?
or another command to make it start another line?
Jonas

Focused, hard work is the real key to success. Keep your eyes on the goal, and just keep taking the next step towards completing it. If you aren't sure which way to do something, do it both ways and see which works better. - John Carmack
User avatar
AndyCR
Posts: 1449
Joined: Wed Jul 06, 2005 5:08 pm
Location: Colorado, USA
Contact:

Post by AndyCR »

i believe it goes like this:

after you write stuff in "cout << "Hello!";", insert \n where you want a newline, example:

Code: Select all

cout << "Hello!\nHi again!";
will turn out like this:

Code: Select all

Hello!
Hi again!
User avatar
QuestOfDreams
Site Admin
Posts: 1520
Joined: Sun Jul 03, 2005 11:12 pm
Location: Austria
Contact:

Post by QuestOfDreams »

The manipulator is endl not end1, which does nothing else but calling put('\n') and flush()
User avatar
jonas
Posts: 779
Joined: Tue Jul 05, 2005 5:43 pm
Location: Texas, USA
Contact:

Post by jonas »

Thanks I'll try it.
Jonas

Focused, hard work is the real key to success. Keep your eyes on the goal, and just keep taking the next step towards completing it. If you aren't sure which way to do something, do it both ways and see which works better. - John Carmack
Voltare
Posts: 263
Joined: Tue Jul 05, 2005 10:36 am

heh

Post by Voltare »

i'm messing around with wxdevc ++, which is dev c++ with wxwidgets inserted..........i'm using it to try to convert the mfc crap in rf and genesis to wxwidgets, and possibly, a form useable by linux........
User avatar
jonas
Posts: 779
Joined: Tue Jul 05, 2005 5:43 pm
Location: Texas, USA
Contact:

Post by jonas »

That would be nice! For some reason end1 or endI don't work even though the tutorial that came with dev-cpp said to use it!:? but I found out that the "\n" function works the best.
Jonas

Focused, hard work is the real key to success. Keep your eyes on the goal, and just keep taking the next step towards completing it. If you aren't sure which way to do something, do it both ways and see which works better. - John Carmack
User avatar
QuestOfDreams
Site Admin
Posts: 1520
Joined: Sun Jul 03, 2005 11:12 pm
Location: Austria
Contact:

Post by QuestOfDreams »

it is neither end1 nor endI, it is endl - that last character is a small L - and means endline :roll: I don't have the devcpp compiler right here but I'm pretty sure it works

btw "\n" means "newline" and it is not a function but an escape sequence
http://www.cprogramming.com/
GD1
Posts: 413
Joined: Tue Jul 05, 2005 2:33 pm

Post by GD1 »

LOL, that really takes me back. When i started programming in Pascal, it took me a good three days to figure out I was typing an i instead of an l, since they look identical in certain fonts. I hate programming. ;)
Check out my band
Tougher Than Fort Knox
Image
Post Reply