+1 to SAMM On Tue, Jul 19, 2011 at 5:32 PM, SAMMM <[email protected]> wrote:
> It is because it doesn't check any bound checking . So overflow can > easily occur without user's concent . > > On Jul 19, 4:48 pm, Ankit Sablok <[email protected]> > wrote: > > Y is it not recommended to use gets in g++ what is the exact reason > > can u tell > > > > On Jul 19, 4:47 pm, SAMMM <[email protected]> wrote: > > > > > > > > > You can try this :- > > > > > fgets(buff,sizeof(buff),stdin) .. > > > It is recomended not to use gets in g++ or gcc .. > > > > > On Jul 19, 4:40 pm, Ankit Sablok <[email protected]> > > > wrote: > > > > > > the gets function gives me error when i execute the following code > > > > plzz provide suggestions and answers > > > > > > char str[100]; > > > > > > while(n--) > > > > { > > > > gets(str); > > > > puts(str); > > > > > > } > > > > > > suggest alternative methods to solve the anomaly- Hide quoted text - > > > > - Show quoted text - > > -- > 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.
