c code for character stuffing
#1

#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<process.h>
void main()
{
int i=0,j=0,n,pos;
char a[20],b[50],ch;
clrscr();
printf("enter string\n");
scanf("%s",&a);
n=strlen(a);
printf("enter position\n");
scanf("%d",&pos);
if(pos>n)
{
printf("invalid position, Enter again :");
scanf("%d",&pos);
}
printf("enter the character\n");
ch=getche();

b[0]='d';
b[1]='l';
b[2]='e';
b[3]='s';
b[4]='t';
b[5]='x';
j=6;
while(i<n)
{
if(i==-1)
{
b[j]='d';
b[j+1]='l';
b[j+2]='e';
b[j+3]=ch;
b[j+4]='d';
b[j+5]='l';
b[j+6]='e';
j=j+7;
}
if(a[i]=='d' && a[i+1]=='l' && a[i+2]=='e')
{
b[j]='d';
b[j+1]='l';
b[j+2]='e';
j=j+3;
}

b[j]=a[i];
i++;
j++;
}
b[j]='d';
b[j+1]='l';
b[j+2]='e';
b[j+3]='e';
b[j+4]='t';
b[j+5]='x';
b[j+6]='\0';
printf("\nframe after stuffing:\n");
printf("%s",b);
getch();
}
----BY SUSH Big Grin
Reply

Important Note..!

If you are not satisfied with above reply ,..Please

ASK HERE

So that we will collect data for you and will made reply to the request....OR try below "QUICK REPLY" box to add a reply to this page
Popular Searches: stuffing bits verilog, implementation of the data link layer framing method such as character stuffing and, program of bit stuffing, algorithm for character stuffing in c with output, implementation of data link layer framing method using bit stuffing, data link layer framing method character stuffing and bit stuffing in java, write a c program to implement the data link layer framing methods such as character stuffing and bit stuffing,

[-]
Quick Reply
Message
Type your reply to this message here.

Image Verification
Please enter the text contained within the image into the text box below it. This process is used to prevent automated spam bots.
Image Verification
(case insensitive)

Possibly Related Threads...
Thread Author Replies Views Last Post
  line word and character segmentation matlab code 1 1,058 11-04-2017, 12:59 PM
Last Post: jaseela123d
  matlab code for adaptive differential pulse code modulation 1 1,131 04-04-2017, 11:49 AM
Last Post: jaseela123d
  force pen airborne character recognition system using inertial i2c mems sensor pdf 1 780 15-03-2017, 03:05 PM
Last Post: jaseela123d
  matlab program for segmentation of line word or character 5 2,810 25-04-2016, 12:26 PM
Last Post: dhanabhagya
  iris code matlab code 1 1,229 17-09-2015, 01:55 PM
Last Post: seminar report asees
  optimal location placement power system distributed generation gams code matlab code 1 938 04-09-2015, 02:05 PM
Last Post: seminar report asees
  in computer networks character count program in c 2 2,334 10-07-2015, 02:16 PM
Last Post: seminar report asees
  line word and character segmentation matlab code 1 845 06-07-2015, 02:22 PM
Last Post: seminar report asees
  matlab code for brain tumor detection using matlab code 1 1,454 27-04-2015, 02:27 PM
Last Post: seminar report asees
  source code ns2 code for saodv 0 912 30-09-2014, 12:59 PM
Last Post: Guest

Forum Jump: