Howdy all,
This has nothing to do with blender, but I figured there would be some coders here who could help me out.
Lets say I have a class, with 2 pointers of type char for data members.
How can I dereference the data members to insert and get data from them?
#include <iostream>
using namespace std;
class Student {
public:
char* Student_Name;
char* Student_idnumber;
private:
};
int main() {
int number;
cout << "Number of students in database: ";
cin >> number;
Student* db = new Student[number];
for( int i = 0; i<number; i++ ) {
cin >> db[i].Student_Name*; // syntax error
cin >> db[i].Student_idnumber*; // syntax error
}
delete[] db;
}
If I change the char* to string, and get rid of the * everything works fine as is.
Any insight would be appreciated.
Thanks,
Elam