HI all, In my c++ program, I did the following.
......
class thr
{private:
char *d;
......
public:
d =new char[35];
....
}
destructor has the line
delete [ ]d;
i get segmentation error
*** glibc detected *** /usr/bin/perl: free(): invalid next size (normal): 0x0000 000001bc7120 ***
But if I do the following in class,no error comes.
char *d;
char id[35];
Here I need not delete since it will automatically get deleted when it comes out of scope.I need this data in object functions.So is it wrong if I do this way?
help me out,pls.