Problem with Strings and Conversions
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
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){
I don't understand how to get a scanned input into a function such as toupper or isalpha?
Any help is greatly appreciated.!
I tried this but it comes out different.
I placed this into my code but it comes out different, it only checks the first letter. I need it to check every letter inputted by the user.