How to use Struct with a *variable name?
private:
// data containing character strings
// shared by Strings when copying/assigning
struct SharedData
{
char *data; // 0-terminated char array
size_t n; // number of non-0 characters in string
size_t count; // reference count, how many Strings share this object?
};
SharedData *shared; //here i don't understand how to use.
How do I use n?
do I just do this
shared -> n = 3;
I keep getting segmentation faults so i don't know what i am doing. I want
to grab the length of a string and then pass it to n to be stored
No comments:
Post a Comment