PAGE2GO2 HOME | INTERNET NEWS

LeighExchange - Free Advertising Network Stock Research at Internet Speed

Re: unexpected character displayed infront of the variable

 List
Subject: Re: unexpected character displayed infront of the variable
Poster: user923005
Date: 23 Mar 2007 12:43:52 -0700
Related Postings: 1 2
On Mar 23, 12:35 pm, ehabaziz2...@gmail.com wrote: [snip]
> do
> {
> i++;
> (*cust).cust_name[i]=getchar();} while ((*cust).cust_name[i]!='\n');

do { (*cust).cust_name[i++] = getchar(); } while ((*cust).cust_name[i] != '\n');

Or better yet (by far):

fgets(cust->cust_name, sizeof cust->cust_name, stdin);

[snip]

 

Page2Go2.com is not responsible for content of this message.