Log in

View Full Version : Jr Dev Code


Kambic
05-22-2004, 08:44 PM
#include <iostream.h>

int main()
{
<<
cout "Hello, World!"
<<
endl;
return 0;
}

kathgar
05-22-2004, 08:49 PM
You fail.

gandar
05-22-2004, 08:54 PM
I think my eyes are bleeding...

cofruben
05-22-2004, 09:43 PM
lol...

Virus11
05-23-2004, 05:21 AM
Copied that from a tutorial site :lol:

zarcath
05-24-2004, 01:11 AM
lol, I have the c++ book that has that exact excersize.

-Z

Mongrel
05-24-2004, 01:17 AM
Duh, and you can't even write "endl;" correctly.

HeliosSunfury
05-29-2004, 03:32 PM
Nevermind that the cout has no stream insertion operators.

govtcheeze
05-29-2004, 03:51 PM
Last edited by Kambic on 05-25-2004 12:14 AM; edited 1 time in total

owned!

Virus11
05-30-2004, 03:03 AM
Last edited by Kambic on 05-25-2004 12:14 AM; edited 1 time in total

owned!

If I were to edit anything I would just delete all of it.

Yeormom
05-31-2004, 03:36 PM
You would have had better luck if you voided main imo.

m0oni9
06-01-2004, 01:25 AM
main always returns int.

Pyrix
06-01-2004, 02:50 AM
Pls make a multiple Choice question with cin and cout ^^

Kambic
06-02-2004, 08:06 AM
#include <iostream>
#include <string>
using namespace std;

int main()
{
string answer;


while (answer != "Y")
{
cout << "Should Kambic be the next EQEmu Developer?" << endl;
cout << "Please type Y for 'Yes' or N for 'No':" << endl;
cin >> answer;
if (answer != "Y")
{
cout << "die irl plz" << endl;
}

}
cout << "you are teh WIN !!!" << endl;

return 0;
}

mangoo
06-02-2004, 05:25 PM
#include <iostream>
#include <string>
using namespace std;

int main()
{
string answer;


while (answer != "Y")
{
cout << "Should Kambic be the next EQEmu Developer?" << endl;
cout << "Please type Y for 'Yes' or N for 'No':" << endl;
cin >> answer;
if (answer != "Y")
{
cout << "die irl plz" << endl;
}

}
cout << "you are teh WIN !!!" << endl;

return 0;
}

N -- Oh btw, it will always return the "you are teh WIN !!!" line because you didn't include "return 0;" in your if statement. So i r teh WIN !!!

x-scythe
06-03-2004, 04:53 AM
im not a c++ coder...but i know a little about it.
but wouldnt you change this:
#include <iostream>

to:
#include <iostream.h>

once again i dont know a lot about c++ so i could be wrong...

Trumpcard
06-03-2004, 05:14 AM
Nope, dont need to do that anymore..

http://www.cpp-home.com/forum/viewtopic.php?t=252

x-scythe
06-03-2004, 07:11 AM
Trumpcard: awesome link, very informative. thanks

Kambic
06-07-2004, 01:46 AM
Kambic wrote:
#include <iostream>
#include <string>
using namespace std;

int main()
{
string answer;


while (answer != "Y")
{
cout << "Should Kambic be the next EQEmu Developer?" << endl;
cout << "Please type Y for 'Yes' or N for 'No':" << endl;
cin >> answer;
if (answer != "Y")
{
cout << "die irl plz" << endl;
}

}
cout << "you are teh WIN !!!" << endl;

return 0;
}


N -- Oh btw, it will always return the "you are teh WIN !!!" line because you didn't include "return 0;" in your if statement. So i r teh WIN !!!

Of course it will. But not until you answer Y. Until you answer Y to my question, the program loops endlessly. Ahh, my pressssciousss... yesssss.....

m0oni9
06-07-2004, 04:09 AM
If you enter in something like "a b c d e f g" it will read each item individually. You need to either read it all into a buffer at once, or flush the input buffer somehow between prompts.

mangoo
06-07-2004, 05:17 AM
Didn't pay attention to the while loop statement...DIRTY :?