Hi, I have a problem understanding how to convert a string of letters inputted from the user into the function toupper.
ex. input: asdf
output: ASDF
I don't understand how to get a scanned input into a function such as toupper or isalpha?Code:#include <stdio.h> #include <ctype.h> #define SIZE 50 //void ToUpperCase(char, char); int main (void) { int i; char s1[SIZE]; char s2[SIZE]; printf("Please Enter the First String: "); scanf("%s", &s1); printf("\nPlease Enter the Second String: "); scanf("%s", &s2); printf("\n"); for (i=0; i<=SIZE; i++) /*Heres where problem is*/ printf("%s, isalpha(s1[SIZE]) ? "Is " : "Is not ", "a letter"); //ToUpperCase(s1, s2); return 0; } //void ToUpperCase(char, char){
Any help is greatly appreciated.!



LinkBack URL
About LinkBacks


