So I have a problem with using toupper on char *. Let me show you what I tried.
#include <stdio.h>
#include <ctype.h>
#include <string.h>
int main() {
char* shi = command->args[0]; //which is "binance"
while(*shi) {
toupper((unsigned char) *shi);
shi++;
}
printf("Capitalized version is: %s",shi); // which should be "BINANCE".
return 0;
}
This statement
has no effect. The result of the call of
toupperis not used.Also after this while loop
the pointer
shipoints to the terminating character '\0' of the string.. So the following call ofprintfwill deal with an empty string.
You should write for example