| Programming PHP | PERL | ASP| ColdFusion| C++ Chat with other forum members about programming. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
by referring to the code below: void digestline(void) { scanf("%*[^\n]"); /* Skip to the End of the Line */ scanf("%*1[\n]"); /* Skip One Newline */ }can anyone explain what the [\n] parts are? I couldn't find any documentation online referring to such a format.(I found this code on http://vergil.chemistry.gatech.edu/r...torial/io.html )
|
|
|||
y not dear% hope u know it so i m not explaining it* to read all chars from the input (keyboard iostream / io buffer)[] what is contained in it is an regular expression ^ tells not \n a new line charso the first scanf will skips all characters until the newline char is found...where as the second scanf function allows u to only read new line char only and only once ie. while storing to any char array u also stores there a new line char but in case of first u didnt i.e. u discarded the storage if a new line char occurs....but i let u know to which variable the values are going is missing.................anyway rank my answer which encourage me to answer morehttp://www.geocities.com/ankur899/
|
![]() |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
All times are GMT. The time now is 12:25 AM.
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
Ad Management by RedTyger





Linear Mode
