is there a method in c++ to find the length of string*?
A string* is a pointer to an object of type string.
A pointer is typically the size of an int or two, but it's dependent on your system. You can find the size of any object with sizeof.
int size = sizeof(someStringPointer);
I suspect you actually want to know the length of a string object, rather than the size of a pointer. If the string object is a std::string, it comes with the member function length() and also size().
string someString("A nice string to use as an exmaple");
int size = someString.size();
If you meant a C-style array of characters, you can use the strlen function, as follows.
/* strlen example */
int main ()
printf ("Enter a sentence: ");
printf ("The sentence entered is %u characters long.\n",strlen(szInput));
Edited 6 Years Ago
by Moschops: n/a
Your question is kind of vague, but possible any one of these :
string->size(); //if you are using std::string *
strlen(string); //if you are using c-style string
i think this is usefull, a lot of the users have problems with .Net Framework installation,
Error code: HRESULT 0xc8000222
Do these to solve:
a: Click Start > ...
There are a number of very old threads on CUDA so I'm starting a new one rather than resurrecting an old one.
Does anyone here have any experience setting up ...
ive been develop a project known as ordering system
i need to delete data from db by clicking the button
ive follow a tutorial from utube and to the exact ...