Re: [Linux-programlama] C ile Komple Cümleyi Almak

---------

New Message Reply About this list Date view Thread view Subject view Author view Attachment view

From: Nilgün Belma Bugüner (nilgun@belgeler.gen.tr)
Date: Thu 05 Jan 2006 - 16:25:54 EET


Selam,

Per 05 Oca 2006 16:13 sularında, Recai Oktas şunları yazmıştı:
> * Nejat AYDIN [2006-01-05 05:13:40+0200]
> > Alper KANAT wrote:
> > >Ufak bir proje için C'de bir program yazmam gerekiyor. Kullanıcının
> > >girdiği bir cümleyi bir array'in içine koymak istiyorum. scanf boşluk
> > >karakterini almadığı için benim için sorun oluyor. gets kullandığımda
> > >nedense program giriş almadan sonlanıyor.
> >
> > Asla ve asla gets kullanma. ASLA!
>
> Gayet yerinde bir uyari, pekistirici olmasi icin 'info libc "Line Input"'
> ile ulasilabilecek "GNU C Library" uyarisi:
>
> - Deprecated function: char * gets (char *S)
> The function `gets' reads characters from the stream `stdin' up to
> the next newline character, and stores them in the string S. The
> newline character is discarded (note that this differs from the
> behavior of `fgets', which copies the newline character into the
> string). If `gets' encounters a read error or end-of-file, it
> returns a null pointer; otherwise it returns S.
>
> *Warning:* The `gets' function is *very dangerous* because it
> provides no protection against overflowing the string S. The GNU
> library includes it for compatibility only. You should *always*
> use `fgets' or `getline' instead. To remind you of this, the
> linker (if using GNU `ld') will issue a warning whenever you use
> `gets'.
>
Türkçesi de var:
http://belgeler.org/glibc/glibc-Line-Input.html#glibc-gets

Esen kalın,
Nilgün

_______________________________________________
Linux-programlama mailing list
Linux-programlama@liste.linux.org.tr
http://liste.linux.org.tr/mailman/listinfo/linux-programlama


New Message Reply About this list Date view Thread view Subject view Author view Attachment view

---------

Bu arsiv hypermail 2.1.2 tarafindan uretilmistir.