I seem to be having a few problems with pointers at the moment. At the moment I have a char pointer as a parameter in one class. The function is being used in another class and is being used to get an input file.
ClassA* CAptr = new ClassA;
char* p = "test.txt";
CAptr->Load(p);
delete p, CAptr;
the function itself
int ClassA::Load(char *FName)
{
ifstream ipf;
ipf.open(FName);
char c;
int FSize = 0;
if(!ipf)
return 0;
else
{
//blah blah blah
}
}
when debugging it shows "bad ptr" and "0xcdcdcdcd" when the function is called.
i'm not really used to using char pointers but i figured i'd give them a try.
any help would be appreciated.