Char array: assign value and loop
#include <stdio.h>
#include <conio.h>
int main(void)
{
char str[80];
int i;
printf("Enter message (less than 80 characters)\n");
for(i = 0; i < 80; i++) {
str[ i ] = getche();
if(str[ i ]=='\r')
break;
}
printf("\n");
for(i = 0; str[ i ] != '\r'; i++)
printf("%c", str[i]+1);
return 0;
}
Related examples in the same category