Mail Archives: djgpp/2000/07/29/12:45:26
From: | "Paulo J. Matos aka PDestroy" <pdestroy AT netcabo DOT pt>
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | fgets Max Chars
|
Date: | Sat, 29 Jul 2000 17:06:13 +0200
|
Lines: | 26
|
Message-ID: | <8luvll$tj6$1@duke.telepac.pt>
|
NNTP-Posting-Host: | 213.22.2.157
|
X-Priority: | 3
|
X-MSMail-Priority: | Normal
|
X-Newsreader: | Microsoft Outlook Express 5.50.4133.2400
|
X-MimeOLE: | Produced By Microsoft MimeOLE V5.50.4133.2400
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Reply-To: | djgpp AT delorie DOT com
|
Hi,
Check the following:
#include <stdio.h>
int main(void) {
char *s;
s=malloc(3000);
fgets(s, 3000, stdin);
return 1;
}
Althought I malloced 3000 chars I am only able to write 129... For example:
Compile it, and just start to write... After a bunch of chars (129 from my
experience), your PC will beep and you cannot write anything more. Why and
how can I solve this since I need to receive big strings from user?
Best regards,
--
Paulo J. Matos aka PDestroy
http://www.pdestroy.net
ICQ UIN - 361853
- Raw text -