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.
This is a discussion on Help with char within the C++ Programming forums, part of the General Programming Boards category; Can anyone please give me a little piece of code which I could use to get a substring of a ...
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.
I support http://www.ukip.org/ as the first necessary step to a free Europe.
or maybe with the string library...
Code:char s[256] = "some really long string..."; std::string sub(s, 1, 255);