help with sizeof() in HIPPO-C

Jay Fields jayf at islenet.UUCP
Mon Sep 9 17:22:08 AEST 1985


> Just discovered that there does not seem to be a sizeof() function
> in Hippo C level I or II.  This would sure be useful for passing
> the number of elements to an array sorting function like
> sort(arrayname,sizeof(array[])/sizeof(array[element0]))
> 
> Thanks in advance for any comments/ideas.
> 
> j fields
> ...!ihnp4!islenet!jayf

Hippo C requires arrays of functions to be initialized thusly:

struct test {int time,code;} bench[7] {
     {140,20},
     {127,50},
     {88,40},
     {125,10},
     {68,70},
     {182,60},
     {148,30}
};

I understood that most compilers did not require the nesting of 
braces so long as the elements were declared in the correct 
order, and I did not realize (later on) that sizeof() was a
compile time feature.  More than one of us, in the class I was
taking, made this mistake.  

Hippo~C, it turns out, also requires the seven (bench[7]).  Other
compilers will figure out that there's suppose to be a seven there
and put one in on their own so to speak.

Once the Hippo people got back from the computer show I found
their support to be top notch.  How many software companies do 
you know who's technical types will answer the phone at all hours
of the night and early morning?

Aloha,
J Fields
....ihnp4!islenet!jayf



More information about the Comp.lang.c mailing list