Path: csiph.com!news.redatomik.org!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!feeds.phibee-telecom.net!border2.nntp.ams1.giganews.com!nntp.giganews.com!buffer2.nntp.ams1.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail NNTP-Posting-Date: Sat, 13 May 2017 08:19:07 -0500 From: Gareth Owen Newsgroups: comp.lang.c Subject: Re: What am I doing wrong here? References: Date: Sat, 13 May 2017 14:19:06 +0100 Message-ID: <87o9uwnbcl.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) Cancel-Lock: sha1:HDVHZopXv0tUaNL1bA5WvCqiezQ= MIME-Version: 1.0 Content-Type: text/plain Lines: 22 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-YKuNcO6YvyyeA7ypAW8PiMyaFtPdKPFbVV0p3snPszRYZXxvveAFu5+Vv4WEV/vG/VUFQU+taJkjEGv!RnqCClph7tss4zJx88G6FaLQ1Qw5rOLzJ65p/VfCxBA5vLfCRNEWy+AiG7NGQl4rHNHoVD4= X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 1608 Xref: csiph.com comp.lang.c:109878 DFS writes: > int main(int argc, char *argv[]) > { > > int i; > char *randName[2]; This is an array of 2 unitialised pointers, that never get initialised. You want char randname[2]; /* 2 bytes of storage for writing a letter and a NULL-byte */ > int randRate[8]; char randRate[3]; /* you're writing a string representation of an int, so you need a string / array of chars to write it to - 3 bytes for two digits and NULL-byte*/ > char *randJob[11]; char randJob[11]; /* 11 bytes of storage */