@SAGAR please explain ur preference for fgets instead of gets? On Tue, Jul 5, 2011 at 11:43 PM, sagar pareek <[email protected]> wrote:
> instead of using gets , use fgets.... > google the difference :) > > On Sun, Jul 3, 2011 at 3:42 AM, Avi Dullu <[email protected]> wrote: > >> #include <stdio.h> >> #include <string.h> >> #include <stdlib.h> >> >> int main() { >> int n, num, i; >> scanf("%d", &n); >> for (i = 0; i < n; ++i) { >> char ch = '#'; >> printf("scanned from %d line: ", i + 1); >> while (ch != '\n') { >> scanf("%d%c", &num, &ch); >> printf("%d ", num); >> } >> printf("\n"); >> } >> return 0; >> } >> >> Better? >> >> Veni Vedi Slumber ! >> >> >> >> On Sun, Jul 3, 2011 at 2:47 AM, anonymous procrastination < >> [email protected]> wrote: >> >>> Hey Thanks,, >>> I got it.. when I press enter after entering the number it takes that >>> as an empty string. >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "Algorithm Geeks" group. >>> To post to this group, send email to [email protected]. >>> To unsubscribe from this group, send email to >>> [email protected]. >>> For more options, visit this group at >>> http://groups.google.com/group/algogeeks?hl=en. >>> >>> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]. >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> > > > > -- > Regards > SAGAR PAREEK > COMPUTER SCIENCE AND ENGINEERING > NIT ALLAHABAD > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- Saurabh Singh B.Tech (Computer Science) MNNIT ALLAHABAD -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
