@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
@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
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
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
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
@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+
@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...
>
>
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
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
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
10 matches
Mail list logo