Re: [algogeeks] Re: whats d problem wid using gets?

2011-09-09 Thread SANDEEP CHUGH
@PRAVEEN : with scanf , we can read two or more than two variables at a time like scanf(" %s %s"string1, string2) but with gets we can read only one variable gets (string1) we cannot use gets (string1, string2) On Thu, Sep 8, 2011 at 11:05 PM, praveen raj wrote: > @sandeep...dont understan

Re: [algogeeks] Re: whats d problem wid using gets?

2011-09-08 Thread praveen raj
@sandeep...dont understand... plz give an example... With regards, Praveen Raj -- 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 a

Re: [algogeeks] Re: whats d problem wid using gets?

2011-09-08 Thread SANDEEP CHUGH
another problem with gets is that although we can read multiword string but we cannot read multiple strings like with scanf,, On Thu, Sep 8, 2011 at 10:50 PM, praveen raj wrote: > > char str[MAXLINE]; > fp=fopen("ABC.txt","r"); > > syntax: > > fgets(str,MAXLINE,fp); > With regards, > > Praveen

Re: [algogeeks] Re: whats d problem wid using gets?

2011-09-08 Thread praveen raj
char str[MAXLINE]; fp=fopen("ABC.txt","r"); syntax: fgets(str,MAXLINE,fp); With regards, Praveen Raj -- 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

Re: [algogeeks] Re: whats d problem wid using gets?

2011-09-08 Thread kartik sachan
using gets we can get buffer over as gets doesn't check about the size input so it mai go to that area where our stack base pointer(think in memory layout section) is stored so our programmed doenn't return to orignal state as address is stored there...so it is dangeroues to use -- You receiv

Re: [algogeeks] Re: whats d problem wid using gets?

2011-09-07 Thread PRATEEK VERMA
@harshit it is also possible with scanf("%[^\n]s") for multi word input -- 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+

Re: [algogeeks] Re: whats d problem wid using gets?

2011-09-05 Thread Shashank Jain
@don - how is fgets invoked coz u said we can limit the characters? Shashank Jain IIIrd year Computer Engineering Delhi College of Engineering On Sun, Sep 4, 2011 at 3:56 PM, bharatkumar bagana < bagana.bharatku...@gmail.com> wrote: > gets is deprecated ... that's why gcc gives warning... > >

Re: [algogeeks] Re: whats d problem wid using gets?

2011-09-04 Thread bharatkumar bagana
gets is deprecated ... that's why gcc gives warning... On Sun, Sep 4, 2011 at 12:46 AM, sukran dhawan wrote: > ya +1 to anup.tats why when u use gets() in gcc i reports a warning > > > On Sun, Sep 4, 2011 at 8:40 AM, Anup Ghatage wrote: > >> I had once read somewhere that they had used gets() du

Re: [algogeeks] Re: whats d problem wid using gets?

2011-09-03 Thread sukran dhawan
ya +1 to anup.tats why when u use gets() in gcc i reports a warning On Sun, Sep 4, 2011 at 8:40 AM, Anup Ghatage wrote: > I had once read somewhere that they had used gets() during the first > compilations of unix, and it used to always crash for some test cases. > So after that they stopped usi

Re: [algogeeks] Re: whats d problem wid using gets?

2011-09-03 Thread Anup Ghatage
I had once read somewhere that they had used gets() during the first compilations of unix, and it used to always crash for some test cases. So after that they stopped using it and alerted everyone of the problem.. -- You received this message because you are subscribed to the Google Groups "Algo