Posted by: kb3292 September 9, 2015
C++ Program
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
Read Full Discussion Thread for this article