answersLogoWhite

0


Best Answer

#include <stdio.h>

#include <string.h>

void stuff(char str[40]);

main()

{

char str[40];

int i;

printf("\n enter the string:");

scanf("%s", &str);

printf("\n the given string is:");

printf("\n %s", str);

stuff(str);

}

void stuff(char str[40])

{

int i, j, k = 0, l, n, z;

printf("\n now we are stuffing the data::\n");

n = strlen(str);

for (i = 0; i < n; i++)

{

if (str[i] == '1')

{

k = 1;

for (l = i + 1; l <= i + 5; l++)

{

if (str[l] == '1')

k++;

else

break;

}

if (k == 6)

{

i = i + 6;

z = n + 1;

for (j = z; j >= i; j--)

{

str[j] = str[j - 1];

}

str[j] = '0';

}

}

}

printf("\nThe resultant string after stuffing is..\n");

printf("%s\n", str);

}

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Implementation of data link layer such as character count in c?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the character count method?

This method uses a field in the header to specify the number of characters in the frame. When the data link layer at the destination sees the character count,it knows how many characters follow, and hence where the end of the frame is. The disadvantage is that if the count is garbled by a transmission error, the destination will lose synchronization and will be unable to locate the start of the next frame. So, this method is rarely used.


Bridge is used in which OSI layer?

Layer 2 (Data Link Layer) http://compnetworking.about.com/cs/internetworking/g/bldef_bridge.htm


How do you change data types range in c?

You can not change the range of a data type. It is a function of the implementation and is dependent on the word size of the implementation's computer hardware.


What is data in each layer called?

7. Application Layer - Data 6. Presentation Layer - Data 5. Session Layer - Data 4. Transport Layer - Segments 3. Network - Packet 2. Data Link - Frame 1. Physical - Bit


Which layer is represented by frames?

The data link layer (layer 2) and the physical layer (layer 1) use the constructed frame.


what are the best pratices for the Big Data Implementation?

Wifi


Which osi model layer provides for data security?

Data Link Layer


Bits are packaged into frames at which layer of the OSI model?

Data link layer


What layer arrange signals into logical units of information called frame?

Layer 2 or the 'Data' layer of the OSI model encapsulates either 'bits' from the physical layer (1)- moving up the TCP stack or 'Packets' from the Network layer (3)- going down the the stack. 7 - Application Layer DATA 6 - Presentation Layer DATA 5 - Session Layer DATA 4 - Transport Layer SEGMENT 3 - Network Layer PACKET 2 - Data Layer (Incorporating LLC and MAC) FRAME 1 - Physical Layer BIT A good nmemonic for remembering the data encapsulation in the OSI model is 'Don't Some Peolple Fry Bacon' - Data, Segments, Packets, Bits.


Which layer of the OSI seven-layer model controls the assembly and disassembly of data?

The Transport layer (layer 4) handles segmentation and reassembly of the data.


Implementation of silverlight?

in wireless network our data is travel by air, so whats the sequirty for our data?


What is the layer that frame relay in?

Layer 2 - Data Link layer.