Quantcast
Channel: Go4Expert
Viewing all articles
Browse latest Browse all 1989

Passing a 2d array to a function, using the pointer to a 2D array

$
0
0
Hi,

I am trying to make a program, a read from the keyboard a 2d array and print his elements.
It works, but i am not so sure is very good, because when i compile, take a while and it finish with a delay.
When I make debug I obtain a segmentation fault. So, I need some help.
Thank you in advance.

#include <stdio.h>​

#define ARRAY_ROW 3
#define ARRAY_COL 3​

void WriteArray3(int(*piData)[ARRAY_ROW][ARRAY_COL])
{
int iRow = 0;...​

Passing a 2d array to a function, using the pointer to a 2D array

Viewing all articles
Browse latest Browse all 1989

Trending Articles