posible minour buggs in dick heathfields book

N

Nomen Nescio

hay, student proggramer 19 yrs old china in computer course
ben doing c proggraming cpl of months from pascal backgrond
enjoyying c unleashed book posible minour buggs found in
dick heathfields data structs cht
buggs not on c unleashed erata witch i looked throughly
grate book lerning lot frmo the c expertts

pg. 348

double Loading[MAX_AGE][NUM_GENDERS] = {0};
//...
void PopulateLoadingArray(double **Loading, size_t MaxAge,
size_t NumGenders)
{
size_t Age, Gender;

for(Age = 0; Age < MaxAge; Age++)
{
for(Gender = 0; Gender < NumGenders; Gender++)
{
**(Loading + Age * MaxAge + Gender) = CalcLoading(Age,
Gender);


cpl qs:

1. why this (Loading + Age * MaxAge + Gender) instead of
(Loading + Age * NumGenders + Gender)?

2. sinze Loading is (double **), does ptr arithmettic
calcullate sizeof(double) elementt or wrong sizeof(double *) elementt,
i not understend? fe. Loading + 1 - this calcullate
Loading + sizeof(double *) .. or Loading + sizeof(double)???

pg. 357

}
free;
}

??? this like return(0); can be return; or such
concet... what hapening here pls?

thx for writting book i lerning a lot much it
keep reading it lern a lot much
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top