EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Archive::Development (https://www.eqemulator.org/forums/forumdisplay.php?f=621)
-   -   Jr Dev Code (https://www.eqemulator.org/forums/showthread.php?t=13932)

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:
Quote:

Originally Posted by Kambic
#include <iostream>

to:
Code:

#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

Quote:

Quote:

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 :?


All times are GMT -4. The time now is 07:18 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.