passing 2d array as parameter to function in c

#include <stdio.h>

//passing 2D array as a parameter to a function
void fun(int *arr, int m, int n)
{
	int i, j;
	for (i = 0; i < m; i++){
	for (j = 0; j < n; j++)
		printf("%d ", *((arr+i*n) + j));
		printf("\n");
	}
}

int main(void)
{
	int arr[][4] = {{1, 2, 3,4}, {4, 5, 6,7}, {7, 8, 9,0}};
	int m = 3, n = 4; //m - no.of rows, n - no.of col

	fun(&arr, m, n);
	return 0;
}

Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
passing dynamic 2d array to function in c c pass multiple dimensional array to function pass 2d array as pointer to function in c how to pass 2 dimensional array in c how to pass 2 dimensional array in function in c passing 2 dimensional array to a function in c how to send 2d arrays as arguments in c c program to add 2d array by passing b=value to function 2d array passing to function how to pass multidimensional array to function in c pass 2d array in fuction in C 2d array c parameter how to declare 2d array as arguements in c__ 2 d array in c as a arguments how to pass 2d array as argument in C pass 2d array to function c pointer pass 2d array to functions in c 2d array in c function pass how to pass a 2d character array in c function two 2d array passing function c passse 2d array in c 2d arry function in c passing 2d array to a function in c__| 2d array as function param in c printing 2d array as function param in c pass a 2d array to a function c how to pass a 2d array as arguement in c c passing values to 2d array get 2d array as parameter in c passing double dimensional array function c how to passs through a 2d array in c through a function c 2 dimensional array parameter passing 2d table to function in c how to pass a declare 2d array into a function c how to pass a delcared 2d array into a function c c pass a 2d array to a function passing 2D array as a parameter to a function in c how to code a function that takes a 2d array as argument in c how to pass 2d array in function in c c programming pass multidimensional array to function c pass pointer of 2d array to a function passing multi dimensional array to function in c passing 2d array as parameter c pass 2d array as argument c how are 2d array passed in c function how to easily send 2D array in function c how to pass 2d array in c c pass 2 dimensional array to function how to get a two dimensional array as a parameter in c passing multidimensional array to a functionin c c pass multidimensional array as argument c programming pass a 2d array to function 2d array passing in c 2d array function parameter C passing a two dimensional array c how to pass 2d matrix in function in c? pass 2 dimensional array C pass multidimensional array to function c pass a 2d array to a function in c how to pass two dimensional array in c function how to pass a 2d array as a function parameter objective c pass a 2d array as return value in c functions in c 2d array argument how to pass 2d arrays in functions in c c how to pass multidimensional array to function how to pass in a 2d array in c parameters for accepting 2d array in c pass 2d array into function c pass array 2d function c pass dynamic multidimentional array as parameter in c while passing 2d array to function in c only first row is correct 2d array as param in c passing a 2d array c c 2d matrix parameter passing a 2d array as function passing an empty 2d array to a function c 2d matrix as parameter c c 2 dimensional array function parameter how to send a 2d array with no values to a function in c receive a 2d array address in function C how to pass 2d array size to function C pass a 2d array to c func passing matrix as parameter in c pass an array 2d to a function c how to pass an 2d array to a function in c how to pass a 2d array to a function c how to pass 2d array in a function in c pass 2d array in function c passing multidimensional arrays to a function in c howw to pass a 2d array as argument in c 2d array variablen c functions passing in a 2d array in c passing an 2d array to a function in c c programming 2d array function parameter passing 2d array to function in c by reference c pass a 2d array to function c two dimensional array passing passing 2d array by reference to function in c c 2d array as function parameter pass 2d array as argument in c c pass 2d array as pointer c pass multidimensional array to function c function with 2d array 2d array function in c passing 2d array by reference in c multidimensional array as parameter c++ feed matrix into c function c void 2d array pass a 2d arrau to a function passing vector are 2d array to function in c how to pass matrix as argument in c how to get a 2d array into parameter of method multidimensional array as parameter c can we pass matrix as argumnet pass pointer of 2d arr c function that gets two dimensional array c function that gets two dimentional array register to 2d array in c c function 2 dimensional array declare double array in arguments.of pass by reference 2d array in c pass by reference 2d array pointer in c 2d array function parameter c++ c pass 2d array to function as pointer input data to 2d array in c passing matrix as a pointer c passing static 2d array a parameter is not allowed cant pass 2d array to function c send 2d array to function c how to send a 2d array to a function in c pass by reference 2d array c pass 2d array as parameter c how to pass a 2d array in a function c pass 2d array as pointer c++ how to pass integer arrays in c how to pass 2d array in function in c++ how to pass a 2d array three things how to pass multidimentional array c pass pointer of 2d array to function how to accept a 2d array in c using function passing 2d array in c why is first blank c 2d array parameter 2d array parameter in c how to pass 2d array as argument in c++ c how to pass 2d array to function can we pass 2d array to a function in c passing argument into 2 d array in C how to pass 2d array by reference in c how to pass 2d array to function in geeksforgeeks how should i pass multipdimensional array to a function how to pass a 2d array \ how to put two dimension arrays into functions passing 2d array to function c passing a 2d array in C passing of 2d arra in function passing a 2d array as an argument to another function in c c programming how to pass 2d array as argument and parameter passing pointer to 2d array to function in c how to pass 2d array in c how to pass bidimensional array how to pass a 2d array in C send 2d array as parameter how to pass a 2d array c formal parameter for array of pointers to array 2d matrixc++ c pass two dimensional array to function passing two dimensional array to function passing 2d array to function in c using pointers multi dimensional array in function c pass two dimensional array to function c two dimensional array function c how to pass 2d array how to pass 2d array in the function in cpp sending 2d array to function in c how to pass 2d array into function c++ how to pass multidimensional array in c how to pass 2d array as pointer in c multidimensional arrays in c with functions how to pass a 2d array to a function by reference how to pass a matrix to a function in c Passing a matrix in a function C pass 2d matrix to function in c pass 2d array in function c++ how to pass 2d array in a function in c++ how to pass 2d array as a 1d array passing 2d array as reference in function passing a 2 d array to function by refrence pass a 2d array as a parameter in c pass a 2d array by reference in c pass 2d array to function print 2d array python how to pass a 2d matrix in a function send 2d array to a function in c passing 2d array in functions c 2d array as argument how to pass a 2 d array c pass 2d array to function passing of 2d array in function 2d array using function in c how to pass 2d array to function in c passing a two dimentional pointer to a function passing 2d array into the functions in c passing 2d matrix to function in c passing matrix as argument c++ how to pass 2d arary to function how to pass a 2d array to a function in c 2d array as argument in c passing 2 d array to function in c c function 2d arry passing 2d array in function c 2d array as parameter 2d array passing to function in c++ how to pass 2d array to a function 2d array function c passing 2d array in c passing 2d array to function as reference in c how to pass a 2d array into a function in c how to pass a 2d array into a function c passing 2d matrix to function in c++ passing a 2d matrix into a function in c== passing 2d arrayto function c++ passing 2d array to function different ways of passing 2d array to function passing matrix to function in c passing 2d array to function in c++ using pointers passing a 2d array in function pass matrix as argument c++ passing 2d matrix to a function how to pass two dimensional array in c passing 2d array in function c 2d array functions c cpp 2d array as parameter how to pass 2d arrays how to pass 2d array in a function C pass 2d array passing 2d arrays to functions in c pass 2d array in c passing multidimensional array to a function in c passing matrices to functions in c Pass a function to a 1D array, 2D array and 3D array using pointer reference AND write three programs separetely. passing 2d array in c++ how to pass a two dimensional array to a function how to pass an 2d array as parameter in c passing 2d arrays in c pass 2d array to function in c how to pass a 2d array to a function in c++ how to put 2d arrays as a parameter in C how to pass a 2d array in function in c++ how to pass a 2d array into a function c++ pass 2d array to function c++ how to pass a 2d array to a function c++ send 2d array to function in c how to pass 2d array to function c++ how to pass a 2D array to a fucntion with a predermined size passing a 2d array to a function C passing 2d array to function in c++ pass 2d array to function c 2d array as parameter c how to pass 2d array in function c by refrence how to pass 2d array in c++ passing a 2d array to a function c++ c++ pass 2d array as argument\ passing 2d array to function c++ how to pass two dimensional array to function in c how to pass 2d array to function in cpp send 2d array to function c++ how to pass 2d array c++ passing two dimensional array to function in c how to pass a 2d array to a function how we can send the two dimensional array to function in c how to pass a 2 dimensional array to a function in c++ passing 2d array to function in c 2d arrays input insode a function passing 2 dimensional array to function in c use 2d array in function c passing 2d array as function argument in c 2d array in function in c 2d array as parameter c++ Pass matrix to function C 2 d array as parameter passing 2d array as parameter passing 2d array as parameter to function in c
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source