answersLogoWhite

0

Character stuffing in C

Updated: 8/11/2023
User Avatar

Wiki User

12y ago

Best Answer

#include

#include

main()

{

char a[30],fs[50]="",t[3],sd,ed,x[3],s[3],d[3],y[3];

int i,j,p=0,q=0;

clrscr();

printf("Enter characters to be stuffed : ");

scanf("%s",a);

printf("\nEnter a character that represents starting delimiter : ");

scanf(" %c",&sd);

printf("\nEnter a character that represents ending delimiter : ");

scanf(" %c",&ed);

x[0]=s[0]=s[1]=sd;

x[1]=s[2]='\0';

y[0]=d[0]=d[1]=ed;

d[2]=y[1]='\0';

strcat(fs,x);

for(i=0;i

{

t[0]=a[i];

t[1]='\0';

if(t[0]==sd)

strcat(fs,s);

else

if(t[0]==ed)

strcat(fs,d);

else

strcat(fs,t);

}

strcat(fs,y);

printf("\nAfter stuffing : %s",fs);

getch();

}

User Avatar

Wiki User

12y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

12y ago

tu76kiktui

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Character stuffing in C
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Write a program in c language to implement framing methods like character stuffing?

A program in c language to implement framing methods like character stuffing can be grave sizeCRC-32 and the variable c50.


What is character stuffing?

In character stuffing tags are used to generate frames.These are the headers using which frames are generated.In this limit of information is more = Character Stuffing = * * *


What is character stuffing in computer network?

In character stuffing tags are used to generate frames.These are the headers using which frames are generated.In this limit of information is moreCharacter Stuffing== Delimit with DLE STX or DLE ETX character flags ==== Insert 'DLE' before accidental 'DLE' in data ==== Remove stuffed character at destination ==


What is byte stuffing in computer networking?

In byte stuffing (or character stuffing), a special byte is added to the data section of the frame when there is a character with the same pattern as the flag. The data section is stuffed with an extra byte. This byte is usually called the escape character (ESC), which has a predefined bit pattern. Whenever the receiver encounters the ESC character, it removes it from the data section and treats the next character as data, not a delimiting flag.


Byte stuffing program in c?

teri bhen ki.....................


What are the benefits of data stuffing?

The following data fragment occurs in the middle of a data stream for which the byte-stuffing algorithm described in the text is used: A B ESC C ESC FLAG FLAG D. What is the output after stuffing?


Wild card character in c plus plus?

There is no wildcard character in C++.


What is the bit stuffing and why you go for byte stuffing?

in bit stuffing we use data in bits !! in byte stuffing we use char !! thus in byte stuffing first char and converted in binary form and then bit stuffing is applied on it


How do you convert a character into its ascii value?

In C a character already is its ASCII value: char c= 'A'; printf ("%c is %d (0x%x hexa)\n", c, c, c);


How do you use the word stuffing in a sentence?

The kitten is tearing the stuffing out of the sofa.I want both kinds of stuffing, please!


Do you cover stuffing when cooking?

It is important to cover stuffing (dressing) while cooking it. One of the important ingredients to a good stuffing is water, and therefore, it can dehydrate making for a dry stuffing. If cooking stuffing, whether in a container by itself or inside a turkey, cover with aluminum foil. Also, if cooking the stuffing inside the turkey, be sure to baste the stuffing exposed while basting the turkey.


How long do you warm up prepared stuffing?

The time to warm up prepared stuffing will vary depending on how much stuffing is being warmed. For a few servings of stuffing, can be warmed in the microwave in about a minute.