Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail |
|---|---|
| From | Ian Collins <ian-news@hotmail.com> |
| Newsgroups | comp.lang.c |
| Subject | Re: a little c programming that no works!! |
| Date | Mon, 27 Jun 2011 16:07:01 +1200 |
| Lines | 37 |
| Message-ID | <96qdvuF2dgU2@mid.individual.net> (permalink) |
| References | <e4f31412-ae7a-455f-9296-3cca0bbccedb@g16g2000yqg.googlegroups.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=ISO-8859-1; format=flowed |
| Content-Transfer-Encoding | 7bit |
| X-Trace | individual.net LCpA/Stih671ikRAtGQiKgxTOdeXU3K/JzklNpcGTNFpLNMObM |
| Cancel-Lock | sha1:Bwdx0WW1LQ65f0sHwUJmM/ApptM= |
| User-Agent | Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:1.9.2.9) Gecko/20101021 Lightning/1.0b2 Thunderbird/3.1.4 |
| In-Reply-To | <e4f31412-ae7a-455f-9296-3cca0bbccedb@g16g2000yqg.googlegroups.com> |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.c:7014 |
Show key headers only | View raw
On 06/27/11 03:50 PM, Vinicio Flores wrote:
> Hello C hackers, this program that I am writing print "Segmentation
> fault" when I execute it, I think that the problem is the gets
> function, but I am not sure
Don't use gets(), use fgets().
<snip>
> static int open_and_fill_database(char *arg)
> {
> FILE *database;
>
> struct datbase_registers *base = malloc ( sizeof(struct registers
> *));
You should check to see if this succeeds!
<snip>
> #define MAX ((900*800)*256)
Are you serious? 184 million!
> struct datbase_registers
> {
> char regname[MAX];
> char name[MAX];
> long int ntel;
> long int age;
> };
So one of these is > 400MB!
--
Ian Collins
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
a little c programming that no works!! Vinicio Flores <vfloreshdz@gmail.com> - 2011-06-26 20:50 -0700
Re: a little c programming that no works!! Ian Collins <ian-news@hotmail.com> - 2011-06-27 16:07 +1200
Re: a little c programming that no works!! Dirk Zabel <zabel@riccius-sohn.eu> - 2011-06-27 11:37 +0200
Re: a little c programming that no works!! Ian Collins <ian-news@hotmail.com> - 2011-06-27 22:44 +1200
Re: a little c programming that no works!! "BartC" <bc@freeuk.com> - 2011-06-27 09:44 +0100
Re: a little c programming that no works!! Barry Schwarz <schwarzb@dqel.com> - 2011-06-27 06:04 -0700
Re: a little c programming that no works!! "Heinrich Wolf" <invalid@invalid.invalid> - 2011-06-27 23:54 +0200
Re: a little c programming that no works!! Lew Pitcher <lpitcher@teksavvy.com> - 2011-06-27 18:11 -0400
Re: a little c programming that no works!! Barry Schwarz <schwarzb@dqel.com> - 2011-06-27 15:44 -0700
Re: a little c programming that no works!! Keith Thompson <kst-u@mib.org> - 2011-06-28 22:40 -0700
Re: a little c programming that no works!! "Heinrich Wolf" <invalid@invalid.invalid> - 2011-06-29 15:44 +0200
Re: a little c programming that no works!! Keith Thompson <kst-u@mib.org> - 2011-06-29 10:06 -0700
csiph-web