prog.cpp:9:2: error: ‘string’ does not name a type
string studentFName;
^
prog.cpp:10:2: error: ‘string’ does not name a type
string studentLName;
^
prog.cpp:16:14: error: variable or field ‘getData’ declared void
void getData(ifstream & inFile, studentType sList [], int size);
^
prog.cpp:16:14: error: ‘ifstream’ was not declared in this scope
prog.cpp:16:14: note: suggested alternative:
In file included from /usr/include/c++/4.8/ios:38:0,
from /usr/include/c++/4.8/ostream:38,
from /usr/include/c++/4.8/iostream:39,
from prog.cpp:1:
/usr/include/c++/4.8/iosfwd:157:34: note: ‘std::ifstream’
typedef basic_ifstream<char> ifstream;
^
prog.cpp:16:25: error: ‘inFile’ was not declared in this scope
void getData(ifstream & inFile, studentType sList [], int size);
^
prog.cpp:16:45: error: expected primary-expression before ‘sList’
void getData(ifstream & inFile, studentType sList [], int size);
^
prog.cpp:16:55: error: expected primary-expression before ‘int’
void getData(ifstream & inFile, studentType sList [], int size);
^
prog.cpp:19:15: error: variable or field ‘printOut’ declared void
void printOut(ofstream & outFile, const studentType sList [], int size);
^
prog.cpp:19:15: error: ‘ofstream’ was not declared in this scope
prog.cpp:19:15: note: suggested alternative:
In file included from /usr/include/c++/4.8/ios:38:0,
from /usr/include/c++/4.8/ostream:38,
from /usr/include/c++/4.8/iostream:39,
from prog.cpp:1:
/usr/include/c++/4.8/iosfwd:160:34: note: ‘std::ofstream’
typedef basic_ofstream<char> ofstream;
^
prog.cpp:19:26: error: ‘outFile’ was not declared in this scope
void printOut(ofstream & outFile, const studentType sList [], int size);
^
prog.cpp:19:35: error: expected primary-expression before ‘const’
void printOut(ofstream & outFile, const studentType sList [], int size);
^
prog.cpp:19:63: error: expected primary-expression before ‘int’
void printOut(ofstream & outFile, const studentType sList [], int size);
^
prog.cpp:21:14: error: variable or field ‘getData’ declared void
void getData(ifstream & inFile, studentType sList [], int size)
^
prog.cpp:21:14: error: ‘ifstream’ was not declared in this scope
prog.cpp:21:14: note: suggested alternative:
In file included from /usr/include/c++/4.8/ios:38:0,
from /usr/include/c++/4.8/ostream:38,
from /usr/include/c++/4.8/iostream:39,
from prog.cpp:1:
/usr/include/c++/4.8/iosfwd:157:34: note: ‘std::ifstream’
typedef basic_ifstream<char> ifstream;
^
prog.cpp:21:25: error: ‘inFile’ was not declared in this scope
void getData(ifstream & inFile, studentType sList [], int size)
^
prog.cpp:21:45: error: expected primary-expression before ‘sList’
void getData(ifstream & inFile, studentType sList [], int size)
^
prog.cpp:21:55: error: expected primary-expression before ‘int’
void getData(ifstream & inFile, studentType sList [], int size)
^
prog.cpp: In function ‘int main()’:
prog.cpp:31:2: error: ‘ifstream’ was not declared in this scope
ifstream infile;
^
prog.cpp:31:2: note: suggested alternative:
In file included from /usr/include/c++/4.8/ios:38:0,
from /usr/include/c++/4.8/ostream:38,
from /usr/include/c++/4.8/iostream:39,
from prog.cpp:1:
/usr/include/c++/4.8/iosfwd:157:34: note: ‘std::ifstream’
typedef basic_ifstream<char> ifstream;
^
prog.cpp:31:11: error: expected ‘;’ before ‘infile’
ifstream infile;
^
prog.cpp:32:2: error: ‘ofstream’ was not declared in this scope
ofstream outfile;
^
prog.cpp:32:2: note: suggested alternative:
In file included from /usr/include/c++/4.8/ios:38:0,
from /usr/include/c++/4.8/ostream:38,
from /usr/include/c++/4.8/iostream:39,
from prog.cpp:1:
/usr/include/c++/4.8/iosfwd:160:34: note: ‘std::ofstream’
typedef basic_ofstream<char> ofstream;
^
prog.cpp:32:11: error: expected ‘;’ before ‘outfile’
ofstream outfile;
^
prog.cpp:34:2: error: ‘string’ was not declared in this scope
string inputFile;
^
prog.cpp:34:2: note: suggested alternative:
In file included from /usr/include/c++/4.8/iosfwd:39:0,
from /usr/include/c++/4.8/ios:38,
from /usr/include/c++/4.8/ostream:38,
from /usr/include/c++/4.8/iostream:39,
from prog.cpp:1:
/usr/include/c++/4.8/bits/stringfwd.h:62:33: note: ‘std::string’
typedef basic_string<char> string;
^
prog.cpp:34:9: error: expected ‘;’ before ‘inputFile’
string inputFile;
^
prog.cpp:35:9: error: expected ‘;’ before ‘outputFile’
string outputFile;
^
prog.cpp:36:9: error: expected ‘;’ before ‘firstname’
string firstname;
^
prog.cpp:37:9: error: expected ‘;’ before ‘lastname’
string lastname;
^
prog.cpp:38:9: error: expected ‘;’ before ‘variable’
string variable;
^
prog.cpp:42:2: error: ‘infile’ was not declared in this scope
infile.open("Ch11_Ex01Data.txt");
^
prog.cpp:43:2: error: ‘outfile’ was not declared in this scope
outfile.open("test.txt");
^
prog.cpp:47:3: error: ‘cout’ was not declared in this scope
cout << "Cannot open the input file" << endl;
^
prog.cpp:47:3: note: suggested alternative:
In file included from prog.cpp:1:0:
/usr/include/c++/4.8/iostream:61:18: note: ‘std::cout’
extern ostream cout; /// Linked to standard output
^
prog.cpp:47:43: error: ‘endl’ was not declared in this scope
cout << "Cannot open the input file" << endl;
^
prog.cpp:47:43: note: suggested alternative:
In file included from /usr/include/c++/4.8/iostream:39:0,
from prog.cpp:1:
/usr/include/c++/4.8/ostream:564:5: note: ‘std::endl’
endl(basic_ostream<_CharT, _Traits>& __os)
^
prog.cpp:49:17: error: ‘system’ was not declared in this scope
system("pause");
^
prog.cpp:51:12: error: ‘firstname’ was not declared in this scope
infile >> firstname >> lastname;
^
prog.cpp:51:25: error: ‘lastname’ was not declared in this scope
infile >> firstname >> lastname;
^
prog.cpp:52:2: error: ‘cout’ was not declared in this scope
cout << firstname;
^
prog.cpp:52:2: note: suggested alternative:
In file included from prog.cpp:1:0:
/usr/include/c++/4.8/iostream:61:18: note: ‘std::cout’
extern ostream cout; /// Linked to standard output
^
prog.cpp:55:16: error: ‘system’ was not declared in this scope
system("pause");
^
prog.cpp:56:2: error: ‘cin’ was not declared in this scope
cin >> variable;
^
prog.cpp:56:2: note: suggested alternative:
In file included from prog.cpp:1:0:
/usr/include/c++/4.8/iostream:60:18: note: ‘std::cin’
extern istream cin; /// Linked to standard input
^
prog.cpp:56:9: error: ‘variable’ was not declared in this scope
cin >> variable;
^
prog.cpp:40:14: warning: unused variable ‘studentsArray’ [-Wunused-variable]
studentType studentsArray[20];
^