![]() |
Passing a two dimensional array to a function
I tried two methods for this and it worked.
First Method : Code:
#include<stdio.h>Second Method : Code:
#include<stdio.h> |
Re: Passing a two dimensional array to a function
Hi,
just a small correction...ur function should rather used passed row an col values insetad of hardcoding them...somehting like this.... Code:
void fun(int *a,int col , int row) |
Re: Passing a two dimensional array to a function
Guys learn to use code block in posts when you have code snippets in the posts. You can refer to the following thread.
http://www.go4expert.com/showthread.php?t=168 |
Re: Passing a two dimensional array to a function
Learning how to indent code as well would be a priority as well.
In response to "method 1". http://c-faq.com/aryptr/ary2dfunc2.html > I tried two methods for this and it worked. Be careful of thinking that "works for me" is any substitute for knowing what is guaranteed by the standard. There are hundreds (possibly thousands) of compilers out there, and you've just tested one of them with a single experiment. |
| All times are GMT +5.5. The time now is 03:19. |