i have here a code that uses pointers to manipulate data in a class...i have a problem of how to show them on screen...i think im using an erroneous syntax...lol...
#include <iostream>
#include <string>
using namespace std;
class MyClass{
public:
string first_name, last_name, id_no;
int age;
};
int main(){
MyClass s;
MyClass* pS;
pS = new MyClass;
pS->first_name = "John Paul ";
pS->last_name = "Dingle ";
pS->id_no = "0321183 ";
pS->age = 20;
cout << s.first_name; << s.last_name << s.id_no << s.age << endl;
delete pS;
return 0;
}
you think im doing the right thing?? lol... help