Advertisement

OK

Started by February 08, 2003 01:22 PM
13 comments, last by cybersniper 21 years, 9 months ago
I now have the Borland C++ builder 6, I looked at all the tutorials but I still don''t no what to do I did the //my first program in C++ #include <iostream.h> int main() { cout << "Hello World!"; return 0; } but nothing isn''t showing up could somebody please help me
CYBER SNIPER
cout is buffered. Add cout << endl; to end the line (and flush the output).

Kippesoep
Advertisement
Ok so you are saying that I should type this

//my first program in C++

#include <iostream.h>

int main()
{
cout << "Hello World!"end1;

return 0;
}
CYBER SNIPER
actually he meant:

cout << "Hello World!" << endl;
// notice the << before endl ?



"No lies of sugar can sweeten the sournes of reality"

}+TITANIUM+{ A.K.A. DXnewbie[onMIRC]
[ ThumbView: Adds thumbnail support for DDS, PCX, TGA and 16 other imagetypes for Windows XP Explorer. ] [ Chocolate peanuts: Brazilian recipe for home made chocolate covered peanuts. Pure coding pleasure. ]
endl, not end1.
No you should type:


  #include <iostream.h>int main(){    cout << "Hello World" << endl;    return 0;}  


Note that that it is ENDL, just in lowercase.
And maybe you want to run it from the command line (start->run, type cmd (or command on win9x/me), press enter, switch to your progs folder using doscommands).
Alternative you can do a .bat file with the content:

exename.exe
pause

and run that bat file.
You can also put an input at the end of the program or system("PAUSE"); before the return 0;.

[My Lousy Page | Kings Of Chaos | Vampires | email.me]
[My Lousy Page | Kings Of Chaos | Vampires | [email=lordlethis@hotmail.com]email.me[/email]]
Advertisement
No, you should type:

        #include <iostream>int main(){    std::cout << "Hello World!" << std::endl;    return 0;}        


:D

Edit: eek! nice catch Arkainium, cheers

Henrym
My Site

[edited by - henrym on February 10, 2003 2:37:06 AM]
No, you should type:


  #include <iostream>int main(){    std::cout << "Hello World!" << std::endl;    return 0;}    




[edited by - Arkainium on February 8, 2003 5:31:57 PM]
can you...

cout << "Hello World!" << flush;

?

I'm not at a comp with a compiler so...thanks

[edited by - kordova on February 8, 2003 10:56:50 PM]
I would go
--------------------------------------------
#include <iostream.h>

int main()
{
cout << "Hello world!" << endl;

return 0;
}
--------------------------------------------

That should work. But that std::cout might have to do if you're using Borland. I don't know if it matters.

Try this:
--------------------------------------------
#include <iostream>
namespace std;

int main()
{
cout << "Hello world!" << endl;

return 0;
}
--------------------------------------------

If that don't work...I ain't gotta clue what you're doin. Maybe you're using your compiler incorrectly.

Moose

[edited by - moose_2006 on February 8, 2003 10:33:30 PM]

This topic is closed to new replies.

Advertisement