I'm fairly new to classes and I know how to read integers from a file into the main, but I'm really getting confused on how to do it in classes.
for example...
I know that you would declare int p in private, but I have no idea where you would do the rest of the stuff. I need to use a class instance to read the files, and then print them.
I know the basics on how to do classes, but I just started it so any help is appreciated. Thanks!
for example...
Code:
ifstream in1("nums.dat");
int ct=0;
int *p=new int[1300];
int forever=1;
while(forever){
in1 >> *(p+ct);
if(*(p+ct) == -1) break;
ct++;
} // WHILE LOOP
I know the basics on how to do classes, but I just started it so any help is appreciated. Thanks!
Comment