Hello everyone i got stuck in compression4 function,I got index value for each character now i have to convert that index value into string to perform bit manipulation operation.i am getting error like invalid operand. I am using sprintf() for converting the integer into string
Sprintf(arraywhereIstoring , type of value to be converted \n , index value); I am using this syntax but giving error If anybody have suggestions for this please discuss.
RCS file: compression7.c,v Working file: compression7.c head: 1.1 branch: locks: strict root: 1.1 access list: symbolic names: keyword substitution: kv total revisions: 1; selected revisions: 1 description: compress7() initalized. ---------------------------- revision 1.1 locked by: root; date: 2017/10/10 05:40:05; author: root; state: Exp; Initial revision ============================================================================= RCS file: decompression.c,v Working file: decompression.c head: 1.2 branch: locks: strict root: 1.2 access list: symbolic names: keyword substitution: kv total revisions: 2; selected revisions: 2 description: In this decompression message is displayed. ---------------------------- revision 1.2 locked by: root; date: 2017/10/12 17:19:00; author: root; state: Exp; lines: +51 -2 In this compressed file is taken and store in an array. and one decompressed file is make. ---------------------------- revision 1.1 date: 2017/10/06 06:08:05; author: root; state: Exp; Initial revision =============================================================================
RCS file: extract.c,v Working file: extract.c head: 1.1 branch: locks: strict root: 1.1 access list: symbolic names: keyword substitution: kv total revisions: 1; selected revisions: 1 description: In this extract function is initalize. the purpose of it to extract the original character from our asii code had maken. ---------------------------- revision 1.1 locked by: root; date: 2017/10/12 17:19:53; author: root; state: Exp; Initial revision
While i am doing Compression for a file whose co of distinct character(Encryption key) value is 11 when i compress this file it gone success but when i am compressing another file whose no of distinct character (encryption Key) value is 10,then it also gone success but the no of unique character now becomes 11 (10 distinct character of this file + 01 no of distinct character of previous file) it overwrites only 10 characters but previous file has 11 distinct character so 01 character is still remaining in the file and append with this new 10 character.
If anyone have some idea about it why it is happening and how i can fix this please discuss.
hi himanshu, u can nullified the before writing data on same file using memset function. Which is used as:
void *memset(void *s, int c, size_t n);
The memset() function fills the first n bytes of the memory area pointed to by s with the constant byte c. In your code u, can use the value of c is 0. so, that it make empty file before writing data on it.