Ouput In String In Uppercase
Code:
I have a program that takes in a string of less than 80 characters from keyboard.
AND it will convert all alphabets into UPPERCASE.
But I do not know how to exclude numbers, punctuations, hyphens, spaces, symbols etc. when displaying.
for the time being my program is this:
#include <stdio.h>
#include <ctype.h>
void upstr(char *s)
{
char *p;
for (p = s; *p != '\0'; p++)
*p = (char) toupper(*p);
}
int main(void)
{
char mystring[] = "strawberry cake!";
puts(mystring);
upstr(mystring);
puts(mystring);
return(0);
}
how do i exclude this punctuations and spaces???
i need HELP!!!