PDA

View Full Version : مشکل در ورودی و حافظه



american_iran2006
سه شنبه 26 دی 1385, 15:33 عصر
سلام دوستان ::


من میخوام که یه متن 50 خطی ویا بیشتر یا کمتر رو وارده برنامه کنم ::


اما مشکل این جاست که این کارو باید یا کپی و پیست انجام بدم:::


خوب scanf به اولین کاراکتره space بقیه ورودی رو ول میکنه
بعد gets هم به اولین کاراکتر خط بعد میرسه بقیه رو ول می کنه

نمی دونم از چه تابعی استفاده کنم که نه به کاراکتره خط بعد حساس نباشه و نه به space

:::::::::::::::::::::::::::::::::::::::::::::::::: :::::::::::::::::::::

sh_roohani
چهارشنبه 27 دی 1385, 10:15 صبح
سلام،


getc, getwc, getchar, getwchar

Read a character from a stream (getc, getwc), or get a character from stdin (getchar, getwchar).

--------------------------------------------------------
int getc(FILE *stream);
wint_t getwc(FILE *stream);
int getchar(void);
wint_t getwchar(void);
--------------------------------------------------------

Parameter

stream Input stream.

--------------------------------------------------------

Return Value

Returns the character read. To indicate a read error or end-of-file condition, getc and getchar return EOF, and getwc and getwchar return WEOF. For getc and getchar, use ferror or feof to check for an error or for end of file.




منبع: MSDN