Thread: Need a quick check for this function call

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Feb 2013
    Posts
    41

    Need a quick check for this function call

    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
    Last edited by phillyflyers; 04-17-2013 at 10:40 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Quick check
    By SofaWolf in forum C Programming
    Replies: 6
    Last Post: 06-26-2012, 12:53 PM
  2. Need a quick check
    By Aliaks in forum C++ Programming
    Replies: 7
    Last Post: 06-05-2009, 04:57 AM
  3. Quick input check question
    By Jozrael in forum C++ Programming
    Replies: 3
    Last Post: 01-20-2009, 07:23 AM
  4. Quick check on reading in + using strings
    By advancedk in forum C Programming
    Replies: 2
    Last Post: 12-08-2008, 10:12 PM
  5. Need advice: catch exceptions or call methods to check bits?
    By registering in forum C++ Programming
    Replies: 1
    Last Post: 10-03-2003, 01:49 PM