why does this gives string subscript out of range exception?
0 Answers
why does this gives string subscript out of range exception?
| Flag | PURGE
string s;
s.reserve(100);
int i = 0;
for( i = 0 ; i < 10; ++i)
s[i] = i + '0';
s[i] = '\0';
Email me when people comment.
Email me when people comment.
Loading...
An error occurred in subscribing you.
Email me when people comment.
Email me when people comment.
Loading...
An error occurred in subscribing you.
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.