This block of code is a simple "convert to uppercase" program but, when I compile, I get the error that is the title above. Any solutions?
char *input = argv[1];
printf("%s\n", input);
char toUpper = ("%s\n",toupper(input));
printf("%s\n", toUpper);
This block of code is a simple "convert to uppercase" program but, when I compile, I get the error that is the title above. Any solutions?
char *input = argv[1];
printf("%s\n", input);
char toUpper = ("%s\n",toupper(input));
printf("%s\n", toUpper);
toupper() does just one char (int).
You need to do each char...
for (char *x=input, *x, x++) *x = toupper(*x);
That changed the string, so then print as before.
printf("%s\n", input);