@PRAVEEN :
with scanf , we can read two or more than two variables at a time
like
scanf( %s %sstring1, 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 praveen0...@gmail.com wrote:
@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
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
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
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 praveen0...@gmail.com wrote:
char str[MAXLINE];
fp=fopen(ABC.txt,r);
syntax:
fgets(str,MAXLINE,fp);
With regards,
@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
@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...
On
gets is deprecated ... that's why gcc gives warning...
On Sun, Sep 4, 2011 at 12:46 AM, sukran dhawan sukrandha...@gmail.comwrote:
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 ghat...@gmail.com wrote:
I had once read
Use fgets instead. It allows you to limit the length of the string. In
general, writing a program which a user can crash or cause to
malfunction by typing too long of an input string is a bad thing.
Don
On Sep 3, 1:37 pm, Shashank Jain shashan...@gmail.com wrote:
Shashank Jain
IIIrd year
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
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 ghat...@gmail.com 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
11 matches
Mail list logo