Mellnik

Untitled

Jun 9th, 2014
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #include <cstdio>
  2. #include <cctype>
  3.  
  4. int main()
  5. {
  6. char *cmdtext = "/ccccccccccccccccccccccccccccccccccccccccc";
  7.  
  8. int pos = 0;
  9. char p_Cmd[32] = "_ce";
  10.  
  11. while (cmdtext[++pos] != ' ' && pos < (32 - 3))
  12. p_Cmd[pos + 2] = tolower(cmdtext[pos]);
  13.  
  14. if (cmdtext[pos] != ' ') //loop above stopped because command name too long
  15. {
  16. //go to position after space char
  17. while (cmdtext[pos] != ' ')
  18. pos++;
  19. }
  20.  
  21. printf("%s - %s\n", p_Cmd, cmdtext + pos);
  22.  
  23. getchar();
  24. return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment