I'll post an example in an edit to this post.
Code:
#include <stdio.h>
#include <ctype.h>
#define SIZE 100
int main() {
int i, n;
char s[SIZE]="";
char ch;
printf("\n\nEnter some letters and numbers, and etc. Only letters will go into the array s[]\n");
i=0;
while((ch=getc(stdin)) != EOF) { //EOF is Ctrl+Z
if(isalpha(ch)) {
s[i++]=ch;
}
}
printf("\n%s", s);
printf("\n\n\t\t\t press enter when ready");
(void) getchar();
return 0;
}
variable++ increments the variable by one.
Yes, you should use a char array.