I'm still a beginner at making function and C programming. I'm trying to make a function for turning it into uppercase, but it seems I messed it up at the pointer(?)
#include <stdio.h>
void mytoupper(char *s[]) {
int i = 0;
while (s[i] != '\0') {
if (s[i] >= 'a' && s[i] <= 'z') {
s[i] = s[i] - 32;
}
i++;
}
return s;
}
int main(void) {
char s[32];
printf("Insert string:");
printf("%s", s);
printf("%s", mytoupper(s[32]));
return 0;
}
scanfinstead ofprintf("%s", s);printf("%s", s);toscanf("%s", s);regardless of other deficiencies.mytoupper(s[32])->mytoupper(s)void mytoupper(char * s[])needs to be eithervoid mytoupper(char *s)orvoid mytoupper(char s[]).printf("%s", mytoupper(s[32]));line second time.