-   Programming (
-   -   Last assignment and I am lost (

Veteq 08-12-2004 12:05 PM

Last assignment and I am lost
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


 *  *        Asgn10.c                              *
 *  *        Written by :        *
 *    *************************************************/
#include <stdio.h>

void name();
int input();

/* define arrays */

int keeper[5];

 *                  main rotine
        int keeper[5];

        printf("%d\n", &keeper[5]);


 *              name rotine                    *
 void name()
        printf("%s\n\n", PROGRAMMER);

 *              Input rotine                    *
int input()
        int f;
        for ( f = 0; f < 5; f++)
            printf("Enter integer number %d : ", f+1);
            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...


kev82 08-12-2004 12:17 PM

before you try fiddling with passing arguments by reference i suggest you learn more basic stuff like syntax a bit better because "int input();" in main makes no sense, and "printf("%d\n", &keeper[5]);" certanly isnt what you want to do.

whens the assignment due?? and have you been to see your tutor?

<edit>if this sounds harsh im sorry but from the current state of the program i see no way to guide you to the answer and i dont want someone to just blurt out the answer as that wont help you.</edit>

Veteq 08-12-2004 01:55 PM

I got it all working, thank you. Once I understood the concept, it was easy.


All times are GMT -5. The time now is 03:11 PM.