Ok guys, I'm about to smash my computer. I am doing this function call the same way I have it in another program but it keeps tell me that when I try to call the function "a" is not indentified. Am I completly missing something?
Code:
#include <stdio.h>
#include <stdlib.h>
int initialize(int a[]);
int main()
{
const int MAXSIZE = 20;
int arr[20] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19};
int selection = 0;
int choice;
printf("Please select an option\n");
printf(" 0 - initialize\n");
printf(" 1 - square\n");
printf(" 2 - halve\n");
printf(" 3 - accumulate\n");
printf(" 4 - transpose\n");
printf(" 5 - shift\n");
printf(" 6 - reverse\n");
printf(" or anything other integer to exit\n");
scanf("%d \n", &selection);
if(selection == 0);
{
choice = initialize(a); //This is where it tell me a is not identified
}
}
int initialize(int a[])
{
int a [20] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19};
int i = 0;
printf("now the array is \n");
for(i = 0; i <= 20; i++)
{
printf("%d", a[i]);
}
return 0;
}
I havent finished the if statement cause that "a not identified" is driving me crazy