[VIEWED 7673
TIMES]
|
SAVE! for ease of future access.
|
|
|
cp21
Please log in to subscribe to cp21's postings.
Posted on 09-08-15 6:15
PM [Snapshot: 131]
Reply
[Subscribe]
|
Login in to Rate this Post:
0
?
|
|
Please need help on this project
|
|
|
|
alece
Please log in to subscribe to alece's postings.
Posted on 09-08-15 7:29
PM [Snapshot: 203]
Reply
[Subscribe]
|
Login in to Rate this Post:
0
?
|
|
Hah! just realized i forgot to do the average part. Hope you can figure that out.
|
|
|
kb3292
Please log in to subscribe to kb3292's postings.
Posted on 09-08-15 11:42
PM [Snapshot: 282]
Reply
[Subscribe]
|
Login in to Rate this Post:
0
?
|
|
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.
|
|
|
helpjava11
Please log in to subscribe to helpjava11's postings.
Posted on 09-09-15 8:47
AM [Snapshot: 367]
Reply
[Subscribe]
|
Login in to Rate this Post:
0
?
|
|
Not from C background but why not create a Global variable holding array and access it from any methods?
|
|
|
alece
Please log in to subscribe to alece's postings.
Posted on 09-09-15 8:58
AM [Snapshot: 383]
Reply
[Subscribe]
|
Login in to Rate this Post:
0
?
|
|
@helpjava11.. coz global variables are bad ?
|
|
|
kb3292
Please log in to subscribe to kb3292's postings.
Posted on 09-09-15 10:36
AM [Snapshot: 414]
Reply
[Subscribe]
|
Login in to Rate this Post:
0
?
|
|
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
|
|
|