![]() |
|
#1
|
|||
|
|||
Help with an array using pointersI have to write a program that defines an array of ten pointers to floating point numbers. Then read from the keyboard ten numbers into the individual loactions accessed by the pointers. Then add all of the numbers and store the result in a pointer accessed location. Diplay the contents of all of the locations including the total. Then finally display the array in reverse using pointers and pointer arthimetic.
I think I have created a program that does all of this but I had to do it using integer. I can' t get it to work using float. Can somebody please help me. CPP / C++ / C Code:
|
|
#2
|
||||
|
||||
|
Well, if it works for integer, than why wouldn't it work for floats?
Just create a pointer to float array, instead of pointer to int. The behaviour should be the same: CPP / C++ / C Code:
Regards, Lucian __________________
Please read these Guidelines before posting on the forum "A person who never made a mistake never tried anything new." Einstein |
Recent GIDBlog
Welcome to Baghdad by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| array of pointers to ...... | kai85 | C++ Forum | 1 | 18-Apr-2005 17:06 |
| [Tutorial] Pointers in C (Part I) | Stack Overflow | C Programming Language | 1 | 08-Apr-2005 18:35 |
| template comiling problems - need expert debugger! | crq | C++ Forum | 1 | 01-Feb-2005 21:26 |
| array of pointers to strings | mirizar | C++ Forum | 5 | 21-Jan-2005 10:24 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The