I'm trying to convert a char *
to uppercase in c, but the function toupper()
doesn't work here.
I'm trying to get the name of the the value of temp, the name being anything before the colon, in this case it's "Test", and then I want to capitalize the name fully.
void func(char * temp) {
// where temp is a char * containing the string "Test:Case1"
char * name;
name = strtok(temp,":");
//convert it to uppercase
name = toupper(name); //error here
}
I'm getting the error that the function toupper()
expects an int
, but receives a char *
. Thing is, I have to use char *
s, since that is what the function is taking in, (I can't really use char
arrays here, can I?).
Any help would be greatly appreciated.
upstr
? The Debian manpage forupstr
says that it is from the "Alliance CAD System." – Berdichev