Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Nword(char* initialString, int position)
- {
- if (position == 0)
- {
- std::cout << -1;
- return;
- }
- else if (position == 1)
- {
- while (*initialString != ' ')
- {
- //initialString = initialString + 1;
- std::cout << *initialString;
- if (*initialString != '\0')
- initialString = initialString + 1;
- else return;
- }
- return;
- }
- else
- {
- if (*initialString == ' ')
- return Nword(initialString + 1, position - 1);
- else
- {
- return Nword(initialString + 1, position);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement