Find the answer to your Linux question:
Results 1 to 2 of 2
i have three c programs eg : use.c client.c and card.c.........in which i have included client.c as a header to use.c, the client.c has a 2 dimensional arraywhich stores some ...
  1. #1
    Just Joined!
    Join Date
    Dec 2007
    Location
    bangalore
    Posts
    38

    EXECVE problem

    i have three c programs eg : use.c client.c and card.c.........in which i have included client.c as a header to use.c, the client.c has a 2 dimensional arraywhich stores some results and i have to use that in card.c..........now while executing use.c i execve a shell program named date from that shell program i m executing card.c .now when in card.c i need the reults of the 2 dimensional array in client.c ...........but i m unable to get it...............can anyone help.?
    use.c***************
    #include"client.c"
    int main(int argc,char *argv[])
    {
    extern char b[12][20];
    robin();
    execve("./date",argv,NULL);
    }
    client.c
    char b[12][20];
    int robin()
    {
    ..........
    commands...
    ...
    }
    date(shell script)
    {
    #!/bin/sh -f
    ./card
    }
    card.c
    #include"client.c"
    int main()
    {
    extern char b[12][20];
    for(i=0;i<12;i++)
    printf("%s",b[i]);
    }
    we know that when we do exec the calling program is replaced by the new program but is there anyway to get the array after exec
    can anyone help me ........reply quickly plzzzzzzzzzzzzz

  2. #2
    Linux Engineer wje_lf's Avatar
    Join Date
    Sep 2007
    Location
    Mariposa
    Posts
    1,192
    No, there isn't. Sorry this wasn't quicker, but I was on the road.
    --
    Bill

    Old age and treachery will overcome youth and skill.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...