EmbLogic's Blog

Category Archives: Data Structures with C

doubts of structure

struct abc{ char ch; }; printf(“%d”,sizeof(abc));//prints 1 byte but struct abc { int i; struct a{ char ch; }; }abc; printf(“%d”,sizeof(abc));//prints only 4 bytes but if we define the variable for struct a then it prints the size along with … Continue reading

Posted in Data Structures with C | 2 Comments

Number of statements in for loop?

for(i=0;i<n;i++) { k = k + 1; }

Posted in Data Structures with C | Tagged , | 1 Comment

Function’s

Functions in C language are very similar to mathematical functions. As we know: y = f(x) = 2x + 1 so for x = 0; f(x) = 2*0 + 1 = 1 i.e., y = 1 which gives an integer … Continue reading

Posted in Data Structures with C | Tagged , | Leave a comment

compression project

completed with decryption …….and will work on file io……..

Posted in Data Structures with C, Uncategorized | Leave a comment

Project – Multiple data compression and decopression

Ajay: Works on  arrays, to making a master array from a simple array.And data-types of arrays is character(char) further continue… Harshvardhan Singh: Initial problem solution(correctness),algorithm design  and flow chart design concerning the TIME & SPACE trade-off.INITid design of the code … Continue reading

Posted in Data Structures with C, Uncategorized | 1 Comment

problem in cursor control formatters

when i write the statement – printf(“hello\r..jackie\n..jp\n”); it gives the o/p ..jackie ..jp but when i write the statement – printf(“hello\n..jackie\r..jp\n”); it gives the o/p hello ..jpckie why????  

Posted in Data Structures with C | 1 Comment

ls command

how ls command works internally in linux os?

Posted in Data Structures with C | 3 Comments

c programming “printf format specification”

printf format specification: %[flag][width][.precision][modifier]<type> meaning of fields with e.g.,:    format                                                                        output 1. flag: printf(“%d7s”,”hello”);                                 spacespacehello 2. width: prinf(“%4d”,10);                                         spacespace10 3. precision: (“%.2f”,1.1412);                                                  1.41 4. modifier:    h interpreted as short used with  i,d,o,u,x l interpreted as long used with i,d,o,u,x  L interpreted … Continue reading

Posted in Data Structures with C | Tagged , | 3 Comments

output doubt

read the following code: main() { int *p,a[5]={1,2,3,4,5}; for(p=a;p<&a[5];p++) { *p=p-a; printf(“%d “,*p); } return 0; } theoretical output= 0 4 8 12 16 compiler output=0 1 2 3 4 question: Why p++ (increment in address of p) increments the … Continue reading

Posted in Data Structures with C, Uncategorized | 2 Comments

Problem with bit wise operators

I am trying to pad two characters in num and trying to print the num in bit pattern.But I am getting -1 instead of 1; Output is for 65 – it should be 01000001 but i am getting 0-100000-1 sample … Continue reading

Posted in Data Structures with C | Tagged , | 4 Comments