I cant find whats wrong to this program... im new to C... Please help.
#include <stdio.h>
#include "genlib.h"
#include "simpio.h"
#define size 5
#define size2 3
void getArray (int numbers[][]);
void checkArray (int numbers[][],int space[][]);
int main()
{
int numbers[size][size], i, c, x, y;
bool space[size][size];
for (i=1; i<size; i++)
{
for (c=1; c<size; c++)
{
numbers[i][c] = 0;
space[x][y] = false;
}
}
getArray(numbers);
printf("The elements that are larger than their neighbors are:\n");
for (i=1; i<size2; i++)
{
for (c=1; c<size2; c++)
{
if(space[i][c] = true)
{
printf("%d in location (%d,%d)",numbers[i][c],i+1,c+1);
}
}
}
system("pause");
}
void getArray(int numbers[][])
{
int i,c;
for (i=1; i<size2; i++)
{
for (c=1; c<size2; c++)
{
printf("Enter integer (higher than 0) for space %i,%c:\n");
numbers[i][c]=GetInteger();
}
}
}
void checkArray (int numbers[][],int space[][])
{
int c, x, y;
for (x=1; y<size; y++)
{
for (y=1; y<size; y++)
{
numbers[x][y] = c;
if(c < numbers[x+1][y+1] && c < numbers[x-1][y-1] && c < numbers[x+1][y] && c < numbers[x][y+1] && c < numbers[x-1][y] && c < numbers[x][y-1] && c < numbers[x-1][y+1] && c < numbers[x+1][y-1])
{
space[x][y] = true;
}
}
}
}
1>------ Build started: Project: neighbors, Configuration: Debug Win32 ------
1>Compiling...
1>neighbors.cpp
1>d:\program files\microsoft visual studio 9.0\vc\include\simpio.h(44) : warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> d:\program files\microsoft visual studio 9.0\vc\include\string.h(157) : see declaration of 'strncpy'
1>d:\program files\microsoft visual studio 9.0\vc\include\simpio.h(57) : warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> d:\program files\microsoft visual studio 9.0\vc\include\string.h(74) : see declaration of 'strcpy'
1>d:\program files\microsoft visual studio 9.0\vc\include\simpio.h(98) : warning C4996: 'sscanf': This function or variable may be unsafe. Consider using sscanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> d:\program files\microsoft visual studio 9.0\vc\include\stdio.h(324) : see declaration of 'sscanf'
1>d:\program files\microsoft visual studio 9.0\vc\include\simpio.h(135) : warning C4996: 'sscanf': This function or variable may be unsafe. Consider using sscanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> d:\program files\microsoft visual studio 9.0\vc\include\stdio.h(324) : see declaration of 'sscanf'
1>d:\program files\microsoft visual studio 9.0\vc\include\simpio.h(172) : warning C4996: 'sscanf': This function or variable may be unsafe. Consider using sscanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> d:\program files\microsoft visual studio 9.0\vc\include\stdio.h(324) : see declaration of 'sscanf'
1>d:(8) : error C2087: 'numbers' : missing subscript
1>d:(9) : error C2087: 'numbers' : missing subscript
1>d:(9) : error C2087: 'space' : missing subscript
1>d:(25) : error C2664: 'getArray' : cannot convert parameter 1 from 'int [5][5]' to 'int [][1]'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>d:(43) : error C2087: 'numbers' : missing subscript
1>d:(56) : error C2087: 'numbers' : missing subscript
1>d:(56) : error C2087: 'space' : missing subscript