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
you are asking the size of a pointer on a char. So I guess you're using a 32bit system.
If you're using C++, use std::string :
std::string samplestring("Hello world"); std::cout << samplestring.size() << std::endl;