Line 3: In file included from main.cpp Line 1 (header): 'string' does not name a type Line 2 (header): 'string' does not name a type In function 'int main(int, char**)': Line 9: 'firstname undeclared (first use this function) Line 12: 'surname' undeclared (first use this function) [Build Error] [main.o] Error 1 |
#include <cstdlib> #include <iostream> #include "name2.h" using namespace std; int main(int argc, char *argv[]) { cout << "Enter your first name: "<< endl; cin >> firstname; cout << "Enter your surname: "<< endl; cin >> surname; string name = firstname+" "+surname; cout << "Your name is " << name << endl; system("PAUSE"); return EXIT_SUCCESS; } |
string firstname; string surname; |