I need same help (again)
I am suppose to use pass-by-reference from a sub-rotine to the main() but I am really lost
Code:
/*************************************************
* * Asgn10.c *
* * Written by : *
* *************************************************/
#include <stdio.h>
#define PROGRAMMER "LOST"
void name();
int input();
/* define arrays */
int keeper[5];
/**************************************************
* main rotine
**************************************************/
main()
{
int keeper[5];
name();
input();
printf("%d\n", &keeper[5]);
}
/************************************************
* name rotine *
************************************************/
void name()
{
system("clear");
printf("%s\n\n", PROGRAMMER);
}
/************************************************
* Input rotine *
************************************************/
int input()
{
int f;
for ( f = 0; f < 5; f++)
{
printf("Enter integer number %d : ", f+1);
fflush(stdin);
scanf("%d", &keeper[f]);
}
return &keeper[];
}
The idea is to pass the address of the data in the array to the main rotine but I am having a hard time on this one....please help...
Veteq