Can anyone please give me a little piece of code which I could use to get a substring of a char[256]. The substring I want to get is everything from the second character.
Can anyone please give me a little piece of code which I could use to get a substring of a char[256]. The substring I want to get is everything from the second character.
Code:char *sub = &string[1];
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
or maybe with the string library...
Code:char s[256] = "some really long string..."; std::string sub(s, 1, 255);