Mombu the Programming Forum sponsored links

Go Back   Mombu the Programming Forum > Programming > getchar and character arrays
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 9th March 01:10
cbfalconer
External User
 
Posts: 1
Default getchar and character arrays



Please don't top-post. Your answer belongs after (or intermixed
with) the snipped material you quote. Many people simply ignore
all top-posted articles. If you want help you should cooperate by
following normal usenet protocol. Read the following links:

--
Some informative links: <news:news.announce.newusers
<http://www.geocities.com/nnqweb/>
<http://www.catb.org/~esr/faqs/smart-questions.html>
<http://www.caliburn.nl/topposting.html>
<http://www.netmeister.org/news/learn2quote.html>
<http://cfaj.freeshell.org/google/>
  Reply With Quote


  sponsored links


2 12th March 04:13
External User
 
Posts: 1
Default 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');
}
  Reply With Quote


  sponsored links


Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666