T is for TANK, and T is for TERROR ... and K is the K for KILLING in error.
C++:
1
2
3
4
5
6
7
8
9
10
11
12
| #include <iostream> #include <string> int main () { using namespace std; string str; cin >> str; cout << "u heeft ingevoerd: " << str << endl; return 0; } |
werkt prima hier hoor
Dit leest overigens ook tot de eerstvolgende spatie, als je echt tot het eind zou willen lezen zou je std::getline () kunnen gebruiken:
C++:
1
2
| string str; getline (cin, str, '\0'); |
[ Voor 30% gewijzigd door .oisyn op 09-01-2003 17:09 ]
Give a man a game and he'll have fun for a day. Teach a man to make games and he'll never have fun again.
Verwijderd
Je moet de juiste includes gebruiken zoals in het voorbeeld hierboven. Dan moet het gewoon werken. Geen problemen hiero
ZWAAR bedankt :D!!!!.oisyn schreef op 09 januari 2003 @ 17:07:
C++:
1 2 3 4 5 6 7 8 9 10 11 12 #include <iostream> #include <string> int main () { using namespace std; string str; cin >> str; cout << "u heeft ingevoerd: " << str << endl; return 0; }
werkt prima hier hoor
Dit leest overigens ook tot de eerstvolgende spatie, als je echt tot het eind zou willen lezen zou je std::getline () kunnen gebruiken:
C++:
1 2 string str; getline (cin, str, '\0');
T is for TANK, and T is for TERROR ... and K is the K for KILLING in error.