1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

I need help in Programming in C

Discussion in 'C++' started by imported_geetha, Sep 28, 2007.

  1. imported_geetha

    imported_geetha New Member

    Joined:
    Sep 28, 2007
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Hello,
    I got a networking problem that should be worked out in C.
    we use 01111110 as a flag to delimit the start and end of frames. Bit stuffing allows arbitrary data patterns to be used in a frame and still allow a receiver to determine the beginning and end of a frame. After every 5 consecutive 1's in the data, an extra 0 is added; the process is reversed at the receiver. If there are two consecutive frames, then assume that there is a separate flag for the end of the first and a separate flag for the start of the second. Any frames that do not start or end with a valid flag are discarded.
    Sender: Reads ASCII 0's and 1's entered from the keyboard and frames them with the 01111110 sequence appropriately and after every 5 consecutive 1's in the data, an extra 0 is added.
    Receiver: Takes an ASCII bit stream and breaks it up into frames. Assume that the input is a long character string, which you will read from a file, containing ASCII 0's and 1's. Your output should be a sequence of frames (1 per line) with all flags and stuffed bits removed. If an error is detected, print "Error Detected" and discard the rest of the frame. An error is detected when we see 7 consecutive 1s. Please help me with the C code for this problem.
    Thanks,
    Geetha
     
  2. imported_xpi0t0s

    imported_xpi0t0s New Member

    Joined:
    Jul 18, 2008
    Messages:
    101
    Likes Received:
    0
    Trophy Points:
    0
    Sure. How far have you got and where are you stuck?
     
  3. fvcdaniel

    fvcdaniel New Member

    Joined:
    Oct 18, 2008
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    interesting that...
    what opperation system are you running?
    and what part of code do you have?
    can you post them?
     
  4. ahmed khan

    ahmed khan New Member

    Joined:
    Jun 11, 2011
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    how i can creat c program
     
  5. ahmed khan

    ahmed khan New Member

    Joined:
    Jun 11, 2011
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    dev c++ operating system
     

Share This Page