Please need help on this project
Hah! just realized i forgot to do the average part. Hope you can figure that out.
My friend, you can't "pass" arrays in c or c++, what is passed is pointers. Please read the c documentation or a good c book. The one by Dennis ritchie called "The C programming language" or something along that line is a pretty good one.
Not from C background but why not create a Global variable holding array and access it from any methods?
@helpjava11..
coz global variables are bad ?
Help java,global variables in general are a easy way to cope out. Although it may seem easier because you don't have to pass around information between methods, they are dangerous and can potentenially lead to unintended consequences. It could be okayto use for a tiny little program like this just for demonstration. Just like I mentioned earlier there are too many ways to do this. The original poster was asking how to "pass" arrays in functions. That's why I had to show that you can't pass arrays in c. You pass the address of the first index or the row depending on the dimension of your arrays. Pointers are the way to communicate between functions in c. Global variable are not recommended
Please log in to reply to this post
You can also log in using your Facebook
What people are reading
You might like these other discussions...