getchar and character arrays
oka i am sorry . Is it Oka ?
can I read '\n' using getchar() as I do in scanf ("\n") ?????
please suggested code :
void input (char *n)
////////////////////
{
int i=0;
printf ("\nInput :");
getchar()="\n";
do {
n[i]=getchar();
i++;
} while (n[i]!='\n');
}
void output (char *n)
////////////////////
{
int i=0;
printf ("\noutput :");
do {
printf ("%c" ,n[i]);
i++;
} while (n[i]!='\n');
}
|