There are plenty of similar inquires, but in my case I don\'t understand what isn\'t working:
int mysize = 0;
mysize = sizeof(samplestring) / sizeof(*samplestrin
The sizeof of an element returns the size of the memory allocated for that object. In your example the string is probably declared somewhere as
samplestring[4]
In which case the size of the memory is 4. The method you probably want in your application is
strlen(samplestring);
Which returns the size of the null terminated string (without the termination)