instead of using gets , use fgets....
google the difference :)

On Sun, Jul 3, 2011 at 3:42 AM, Avi Dullu <avi.du...@gmail.com> 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 <
> opamp1...@gmail.com> 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 algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> 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 algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> 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 algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to