Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdio>
- #include <cctype>
- int main()
- {
- char *cmdtext = "/ccccccccccccccccccccccccccccccccccccccccc";
- int pos = 0;
- char p_Cmd[32] = "_ce";
- while (cmdtext[++pos] != ' ' && pos < (32 - 3))
- p_Cmd[pos + 2] = tolower(cmdtext[pos]);
- if (cmdtext[pos] != ' ') //loop above stopped because command name too long
- {
- //go to position after space char
- while (cmdtext[pos] != ' ')
- pos++;
- }
- printf("%s - %s\n", p_Cmd, cmdtext + pos);
- getchar();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment