Hi,
Here's my problem which has me stumped.
My question is - How do I access c[0].name and c[1].name in main(). Also, if I want to pass the whole list of objects to another function in main, how would I do so.
I keep getting segmentation faults for the ways I tried.
Thanks.
Rsshetty.
Here's my problem which has me stumped.
Code:
main()
{
class *A;
int limit;
getVal(A,&limit);
}
void getVal(Class *A,*limit)
{
cout << "get limit" ;
cin << *limit;
c = new Class[*limit];
c[0].name = "some value";
c[1].name = "some other value";
}
I keep getting segmentation faults for the ways I tried.
Thanks.
Rsshetty.