www.delorie.com/djgpp/bugs/show.cgi search
Bug 000321

When Created: 07/06/2000 09:24:43
Against DJGPP version: 2.03
By whom: ThyJok3r@aol.com
Abstract: Parse Error when there is non at all!
```#include <stdio.h>

main(void)
{

int calculations(int [], int [], int [], int []);

int h_shorter[2], h_taller[2], l_shorter_taller[2], l_taller_tree[2];

puts("Height of the shorter person in feet and inches:");
scanf("%d %d", &h_shorter[0], &h_shorter[1]);
puts("Height of the taller person in feet and inches:");
scanf("%d %d", &h_taller[0], &h_taller[1]);
puts("Distance between the two people in feet and inches:\t");
scanf("%d %d", &l_shorter_taller[0], &l_shorter_taller[1]);
puts("Distance between the taller person and the tree:");
scanf("%d %d", &l_taller_tree[0], &l_taller_tree[1]);

calculations(h_shorter, h_taller, l_shorter_taller, l_taller_tree);

}

calculations(int w[], int x[], int y[], int z[])
{

int in_w = (12 * w[0]) + w[1];
int in_x = (12 * x[0]) + x[1];
int in_y = (12 * y[0]) + y[1];
int in_z = (12 * z[0]) + z[1];
in_z += in_y; [I get a parse ERROR on this line! Does that make any sense!]
int a;

int h_ft_tree, h_in_tree, def_taller_shorter;
def_taller_shorter = in_x - in_w;
h_ft_tree = ((def_taller_shorter * (in_y + in_z)) / in_y) + in_w;
h_in_tree = ((def_taller_shorter * (in_y * in_z)) + in_w) % in_y;
a = (def_taller_shorter * (in_y + in_z));
printf("%d %d %d %d %d %d %d %d", h_ft_tree, h_in_tree, in_w, in_x, in_y, in_z, a, def_taller_shorter);
//h_tree[1] = h_tree[0] % 12;
//h_tree[0] /= 12;

//printf("The height of the tree is %d feet %d inches tall.", h_tree[0], h_tree[1]);

}```

By whom: eliz@is.elta.co.il
```This is most probably a cockpit error: the source was compiled as a C program
(by having its name be with a .c extension), but it needs C++, since it has
declarations in the middle of code.

In any case, it doesn't belong here, since it's not a bug in DJGPP.  So I'm
closing this report.```

Closed on 07/07/2000 09:24:46: Either a usage problem or a GCC bug, not a DJGPP bug.
By whom: eliz@is.elta.co.il

 webmaster   donations   bookstore delorie software   privacy Copyright © 2010   by DJ Delorie Updated Jul 2010