EmbLogic's Blog

Category Archives: Data Structures with C

How this output come??? 09/06/12

#include int main() { std::printf(“Strings:\n”); const char* s = “Hello”; std::printf(“\t.%10s.\n\t.%-10s.\n\t.%*s.\n”, s, s, 10, s); std::printf(“Characters:\t%c %%\n”, 65); std::printf(“Integers\n”); std::printf(“Decimal:\t%i %d %.6i %i %.0i %+i %u\n”, 1, 2, 3, 0, 0, 4, -1); std::printf(“Hexadecimal:\t%x %x %X %#x\n”, 5, 10, 10, … Continue reading →

Posted in Data Structures with C | Leave a comment

today 8/6/12

I had complete assignment question up to 10. and got some problem in this question.

Posted in Data Structures with C | Leave a comment

today update 8/6/12

I had complete assignment question up to 23. & got some problem in this question. 6,26.

Posted in Data Structures with C | Leave a comment

today update 8/6/12. Problem in bitwise OR

i had complete assignment qs up to 11. int x=1; printf(“\n %d”,~x|x); output : -1

Posted in Data Structures with C | 2 Comments

c problem

what is the meaning of %8g in c language?    

Posted in Data Structures with C | Leave a comment

Difference between i++ and++i?

Can anyone tell me what is the difference between i++ and ++i w.r.t compiler in C

Posted in Data Structures with C | 1 Comment

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

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(“%7s”,”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 as … 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

FILE read and write

I am performing file read and write operations everything is working fine but my function is not checking EOF. It is not coming out of loop even if i had applied a condition (if character is equal to EOF ). … Continue reading →

Posted in Data Structures with C | 1 Comment