pipes

This is a discussion on pipes within the C Programming forums, part of the General Programming Boards category; Hi, I have the folowing data structures struct account_record { unsigned int account_number; unsigned int pin; long int balance; }; ...

  1. #1
    Unregistered
    Guest

    pipes

    Hi, I have the folowing data structures

    struct account_record
    {
    unsigned int account_number;
    unsigned int pin;
    long int balance;
    };

    struct message
    {
    char transaction_code;
    struct account_record mesage account;
    };

    What I would like to do is pass a message between two programs using a UNIX pipe.

    I've been able to get a pipe working to send and recieve string of char but have'net got a clue when it comes to a data structure!

    Anybody got any idea's

    Thanks for your time.

    AR

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Pass it the same way you read or write any data. If you're using fread or fwrite, just write the size of the item and read that amount from the other end.

    Quzah.
    Hope is the first step on the road to disappointment.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Pipes sometimes fail
    By EVOEx in forum Linux Programming
    Replies: 2
    Last Post: 05-02-2009, 02:47 PM
  2. Pipes
    By Martin Kovac in forum C Programming
    Replies: 1
    Last Post: 03-31-2009, 04:09 AM
  3. pipes in c
    By ajal1 in forum C Programming
    Replies: 6
    Last Post: 10-29-2005, 04:29 PM
  4. Need some help with pipes please.
    By carrja99 in forum C Programming
    Replies: 1
    Last Post: 05-05-2004, 05:13 PM
  5. Services and Pipes
    By nickname_changed in forum Windows Programming
    Replies: 0
    Last Post: 07-16-2003, 07:46 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21