O'Reilly logo
  • Ilija Injac thinks this is interesting:

void convert_to_upper(char *s) {
    int length = strlen(s);

    for (int i = 0; i < length; i++) {
        s[i] = toupper(s[i]);
    }
}

From

Cover of C++ Without Fear: A Beginner’s Guide That Makes You Feel Smart, Third Edition

Note

I solved this a bit differently:
void convert_to_upper(char _s) {
32
33 if(strlen(s) == 0)
34 {
35 return;
36 }
37
38 while(_s)
39 {
40 _s=toupper(_s);
41 *s++;
42 }
43
44 }

What works as well is:
void convert_to_upper(char _s) {
32
33 if(strlen(s) == 0)
34 {
35 return;
36 }
37
38 while(_s)
39 {
40 _s=toupper(_s);
41 s++;
42 }
43
44 }