I am using a pointer (and not a fixed array or a variable) as I don't know before run time, how many heights (of male and female students) will be entered... The input is to be like this:

Code:

how many heights are to be entered? 5
OK, enter the 5 values:
m 169 m 167 f 171 f 169 f 170 (but there could be more depending on user choice)
the average male height is 168
the average female height is 169

Input restriction

Originally Posted by jimblumberg

So where are you allocating any memory for this pointer? Plus you don't actually need an array to compute an average.

Jim

I get it now... I was doing the pointer/array thing the wrong way. Thanks for the reply... What I need to know now is how to make a program accept alternating chars and ints as mentioned in my above post at 3 pm today.