🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #4350

QuickC 1.0 Bug?

#4350
From: mrj
Date: Tue, 22 Jan 1991 17:06
50 lines
1497 bytes
First I know that QuickC 2 is out.... but for those that have QuickC 1,
watch this.  (somebody came to me and asked why the following code
wouldn't work.....)

#include <stdio.h>

int array[10][3];
int i,j;

int main()
{
	for (i=0;i<10;i++)
	{
		j = i + 1;
		array[i][0] = j;
		array[i][1] = j * j;
		array[i][2] = j * j * j;
	}

	for (i=0;i<10;i++)
		printf("%4d  %4d  %4d\n",array[i][0],array[i][1],array[i][2]);

}

Uh.. the output from QuickC looks something like this...
First line...
  0 0 1

I can't remember the rest, but lets just say that it wasn't in anyway
the expected output.  I used the MIPS C compiler, and Turbo C 2.1 to
get the correct output (both gave...), so I must guess the QuickC 1.0
has a bug.  (correct and expected output.)

   1     1     1
   2     4     8
   3     9    27
   4    16    64
   5    25   125
   6    36   216
   7    49   343
   8    64   512
   9    81   729
  10   100  1000

You can understand what a new programer would wonder, if the example from
a book didn't work !!!

Mike.

jones@uvm.edu
Technical Details
Message-ID: <JONES.91Jan22120641@hal.uvm.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!bbn.com!nic!kira!kira!jones

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!bbn.com!nic!kira!kira!jones
From: jones@hal.uvm.edu (mrj)
Newsgroups: comp.os.msdos.programmer
Subject: QuickC 1.0 Bug?
Message-ID: <JONES.91Jan22120641@hal.uvm.edu>
Date: 22 Jan 91 17:06:41 GMT
Sender: news@uvm.edu
Distribution: comp
Organization: Division of EMBA, University of Vermont
Lines: 50
Raymond-Protection: enabled