Chat on IRC |
Passing arrays in C++
Posted by shadow [send private reply] at January 11, 2002, 07:54:14 PM
I am rather new to porgramming in general, and have decided to do little problems to challenge myself and to just learn new things. I am curently working on the Cat in the Hat problem, and want to pass an array to a function to store and display data. I'll use my display function decleration and call as an example.
display_results(not_working, combined_height, i); This is my functiom call display_results(int ¬_working[ ], int &combined_height [ ], int i); My decleration. Any suggestions would be nice. Thanks.
Posted by Psion [send private reply] at January 11, 2002, 09:53:42 PM
Leave out the &'s. Arrays are always passed "by reference" as pointers in C and C++.
Register as a new user | ||||