Hallo,
Ich habe ein kleines Problem mit C++.
Beim Kompilieren mit GCC bekomme ich folgenden fehler:
Mei Code sieht so aus:
Ich hoffe es kann mir wer helfen,
Gruß
Ich habe ein kleines Problem mit C++.
Beim Kompilieren mit GCC bekomme ich folgenden fehler:
Code:
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
Code:
#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;
}
Gruß
Moderator
Kommentar