![]() |
Please solve these problems
3 Attachment(s)
First one is charecter stuffing
I got this program executed successfully but One lock within the input string and if I use more than one lock it prints 2 times the next lock situation… please execute and check the error… check the following attachment to know how i wrote and i'm attaching the .C files too Attachment 659 I'd modified the program which is in above file But this time it reprints the second (further) occurrences of LOCK please solve it the .C files are... Attachment 660 And I wrote bit stuffing with same logic please check it… I got errors as 01111110011111ull pointer assignment Divide error abnormal program termination h..11101001111110 source code is Attachment 661 |
Re: Please solve these problems
if the string is
LOCKEDbymeLOCKEDbyYOULOCKED which one is the correct? |
Re: Please solve these problems
Quote:
LOCKLOCKLOCKEDbymeLOCKLOCKEDbyYOULOCKLOCKEDUNLOCK but with my program it give like this LOCKLOCKLOCKEDbymeLOCKLOCKEDbyYOULOCKLOCKEDbyYOULO CKEDyYOULOCKEDUNLOCK |
Re: Please solve these problems
if i give you a solution with strtok function it will be a problem?
|
Re: Please solve these problems
Quote:
char *strtok(char *s1, const char *s2); The strtok() function gets the next token from string s1, where tokens are strings separated by characters from s2. To get the first token from s1, strtok() is called with s1 as its first parameter. Remaining tokens from s1 are obtained by calling strtok() with a null pointer for the first parameter. The string of delimiters, s2, can differ from call to call. what are these tokens in my program and which arrays i must pass to strtok() please reply me soon sir ... I'm getting my exams near future |
Re: Please solve these problems
i wanted to say strstr not strtok sorry.
here is one solution Code:
#include <stdio.h>and second solution based on your code is Code:
#include<stdio.h> |
Re: Please solve these problems
Sir
What about the bit stuffing problem please help it... too and i'm posting a new program which is written for implementing optimal page replacement algorithm in a new post please help with it sir... |
Re: Please solve these problems
so the program for bits is this
check it. Code:
|
Re: Please solve these problems
Sir we just insert a 0 after each occurrence of 5 continuous 1's in the input string.just like character stuffing we put 01111110 on the beginning and ending of input string...
|
Re: Please solve these problems
examples are
input string: 0111111111111110111111111011111010 output must be 01111110 01111101111101111011111011110111110010 01111110 01111110 is flag bit which will be inserted at beginning and ending 0 is stuffed bit after each occurrence of five continuous one's in the string |
| All times are GMT +5.5. The time now is 22:17. |