Monday 15 April 2013

c++ - pointer arithemetic while using an array of double -


Then I have an indicator for an array of doubles, what I have to do is let me move the cursor to the next position Array is, however, how can I not find any decent documents to do this?

This is my current line that it takes care that the temperature array is an indicator array that looks like this double * temperature = new double [honey of days];

  Cust & lt; & Lt; Setw (10) to be & lt; & Lt; Counter + 1 & lt; & Lt; Setup (10) & lt; & Lt; Temperature + counter & lt; & Lt; "\ 370 C" & lt; & Lt; Setup (10) & lt; & Lt; GetFahrenheit (temperature + counter) & lt; & Lt; "\ 370F" & lt; & Lt; Endl;    

right array element temperature range + counter Unfortunately, this is just an indicator instead of pointer whenever you want signs

> cout < & Lt; Setup (10) & lt; & Lt; Counter + 1 & lt; & Lt; Setup (10) & lt; & Lt; * (Temperature + counter) & lt; & Lt; "\ 370 C" & lt; & Lt; Setup (10) & lt; & Lt; GetFahrenheit (* (temperature + counter)) & lt; & Lt; "\ 370 F" & lt; & Lt; Endl;

Although it is counter-intuitive When you return this assignment, the array index; -).

  cout & lt; & Lt; Setup (10) & lt; & Lt; Counter + 1 & lt; & Lt; Setup (10) & lt; & Lt; Temperature counter [counter] & lt; & Lt; "\ 370 C" & lt; & Lt; Setup (10) & lt; & Lt; GetFahrenheit (temperature at [counter]) & lt; & Lt; "\ 370 F" & lt; & Lt; Endl;   

See pointers dereferencing in any decent C ++ book it should be there.

No comments:

Post a Comment