Compression and decompression is done successfully for code length 4 Now trying to implement compression for code length 3 and 5.
I have implemented the functions for master array generation and for calculation of no of distint character and code length.I have used switch case in main program.
#include<stdio.h> union logic { int i; char x[2]; //char y; }emb={510,’A’,’B’}; int main() { printf(“%d\n”,emb.i); printf(“%c\n”,emb.x[0]); printf(“%c\n”,emb.x[1]); printf(“%d\n”,emb.i); }
#include<stdio.h> #include<string.h> struct logic { char ch[10]; char x; int y; char z; //int i; }; int main() { struct logic *p; strcpy(p->ch,”hello”); p->x=’b’; p->y=42; p->z=’c’; printf(“%s\n%c\n%d\n%c\n”,p->ch,p->x,p->y,p->z); }
i have created three source files and thee header files… the name and containt of these file area as follows… main.c one include file and one printf statment one.c one include file and one printf statments two.c one include file … Continue reading
{ int x=1,y=1,z=1; x+=y+=z; printf(“%d\n”,x<y?y:x); printf(“%d\n”,x<y?x++:y++); printf(“%d\n”,x);printf(“%d\n”,y); printf(“%d\n”,z+=x<y?x++:y++); printf(“%d\n”,y);printf(“%d\n”,z); x=3,y=z=4; printf(“%d\n”,z>=y>=x?1:0); printf(“%d\n”,z>=y&&y>=x)