posible minour buggs in dick heathfields book

Discussion in 'C Programming' started by Nomen Nescio, Oct 27, 2008.

  1. Nomen Nescio

    Nomen Nescio Guest

    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
     
    Nomen Nescio, Oct 27, 2008
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. koli
    Replies:
    0
    Views:
    337
  2. Sergei
    Replies:
    2
    Views:
    378
    Sergei
    Nov 25, 2005
  3. jose luis fernandez diaz
    Replies:
    7
    Views:
    20,259
    Rob Williscroft
    Apr 21, 2004
  4. Replies:
    21
    Views:
    815
    Keith Thompson
    Nov 10, 2007
  5. Replies:
    47
    Views:
    1,127
    Charlie Gordon
    Nov 16, 2007
Loading...

Share This Page