Hello everyone,
Am writing my first C++ program and I've hit the first roadblock as well lol
Heres the code:
When I compile and run it I get the following errorsCode:#include <iostream> class student { public: char studid[5] ; char stuname[20] ; int age ; void accept () { cout << "Enter student ID" << endl ; cin >> studid >> endl ; cout << "Enter your name" << endl ; cin >> stuname >> endl ; cout << "Enter your age" << endl ; cin >> age >> endl ; } void display () { cout << "The entered details are as follows:" << endl ; cout << "studid =" << studid << endl ; } }; main () { student stuobj ; stuobj.accept() ; stuobj.display() ; }
In member function 'void student::accept()':
error : 'cout' undeclared (first use this function)
error: 'endl' undeclared (first use this function)
error : 'cin' undeclared (first use this function)
In member function 'void student::display()':
same errors like above.
Please help