length of a string
I have a character array a[100]. now when the user gives the input -->
Hello World . I want to get the length of the string Hello World which has to be 11 including the space.the answer i get is 5. how do i get the answer 11?
# 2 Re: length of a string
space is normally treated as delimiter
you need to do something like the following
char a[100];
cin.getline(a , 100);