[ create a new paste ] login | about

Link: http://codepad.org/HJneQAbW    [ raw code | output | fork ]

C, pasted on Aug 4:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <stdio.h>

void func2(char (*ar)[]);

int main(void)
{
 char array[3][5] = {{'h','e','l','l','o'}, {'o','l','l','e','h'}, {'e','h','o','l','l',}};
 func2(array);
 return 0;
}

void func2(char (*ar)[])
{
  int i, j;
  for (i = 0; i < 3; i++)
      {
      for(j = 0; j < 5; j++)
          putchar(ar[i][j]);
      putchar('\n');
      }    
}


Output:
1
2
In function 'func2':
Line 18: error: invalid use of array with unspecified bounds


Create a new paste based on this one


Comments: