[algogeeks] Re: GETS
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 ankitsablok19091...@gmail.com 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 -- 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.
[algogeeks] Re: GETS
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 somnath.nit...@gmail.com 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 ankitsablok19091...@gmail.com 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 -- 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.
[algogeeks] Re: GETS
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 ankitsablok19091...@gmail.com 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 somnath.nit...@gmail.com 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 ankitsablok19091...@gmail.com 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 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.
Re: [algogeeks] Re: GETS
+1 to SAMM On Tue, Jul 19, 2011 at 5:32 PM, SAMMM somnath.nit...@gmail.com 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 ankitsablok19091...@gmail.com 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 somnath.nit...@gmail.com 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 ankitsablok19091...@gmail.com 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 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.