Dave McClan
21-05-2007, 22:01
Hallo,
Ich habe ein kleines Problem mit C++.
Beim Kompilieren mit GCC bekomme ich folgenden fehler:
file.cpp: In function 'int main()':
file.cpp:5: error: 'string' was not declared in this scope
file.cpp:5: error: expected `;' before 'username'
file.cpp:6: error: expected `;' before 'command'
file.cpp:7: error: 'username' was not declared in this scope
file.cpp:12: error: 'command' was not declared in this scope
Mei Code sieht so aus:
#include <iostream>
int main() {
string username;
string command;
username = "nicolas";
std::cout << username;
std::cout << "$: ";
std::cin >> command;
std::cout << command;
std::cout << "text_command";
return 0;
}
Ich hoffe es kann mir wer helfen,
Gruß
Ich habe ein kleines Problem mit C++.
Beim Kompilieren mit GCC bekomme ich folgenden fehler:
file.cpp: In function 'int main()':
file.cpp:5: error: 'string' was not declared in this scope
file.cpp:5: error: expected `;' before 'username'
file.cpp:6: error: expected `;' before 'command'
file.cpp:7: error: 'username' was not declared in this scope
file.cpp:12: error: 'command' was not declared in this scope
Mei Code sieht so aus:
#include <iostream>
int main() {
string username;
string command;
username = "nicolas";
std::cout << username;
std::cout << "$: ";
std::cin >> command;
std::cout << command;
std::cout << "text_command";
return 0;
}
Ich hoffe es kann mir wer helfen,
Gruß
