EmbLogic's Blog

Category Archives: Data Structures with C

Data structures in C(assignment-1)

RCS file: ./1.c,v Working file: ./1.c head: 1.1 branch: locks: strict access list: symbolic names: keyword substitution: kv total revisions: 1;    selected revisions: 1 description: printing “Hello Word” using printf —————————- revision 1.1 date: 2014/05/23 11:22:57;  author: root;  state: Exp; … Continue reading →

Posted in Data Structures with C | Leave a comment

Factorial of a number is calculated

RCS file: ./fac.c,v Working file: ./fac.c head: 1.2 branch: locks: strict root: 1.2 access list: symbolic names: keyword substitution: kv total revisions: 2;    selected revisions: 2 description: user enter the number —————————- revision 1.2    locked by: root; date: 2014/05/23 15:15:32;  … Continue reading →

Posted in Data Structures with C | Leave a comment

Difference Between printf() and scanf() in C

printf(): When printf() is used in a progam,that means whatever statement we want to print on the shell will be written inside the double codes i.e printf(“hello”). If we write printf(“Hello\n”) then \n means when Hello is printed on the … Continue reading →

Posted in Data Structures with C | Leave a comment

program to convert decimal to binary & octa & hexa

“1.Binary”; 2.Ocatal; 3.hexadecimal; switch(choice) { case 1: base=2; case 2: base=8; case 3: base=16; “enter your no\n”; convert(num,base); convert(int num,int base) { int rem; rem=num%base; num/=base; if(num>0) convert(num,base); if(rem<10) printf(“%d”,rem); else printf(“%c”,rem-10 + ‘A’); }

Posted in Data Structures with C | Leave a comment

It is always a good practice to assign a NULL value to a pointer variable in case you do not have exact address to be assigned. This is done at the time of variable declaration. A pointer that is assigned … Continue reading →

Posted in Data Structures with C | Leave a comment

volatile modifier in c

All variable in c are by default not volatile. With help of modifier volatile which is keyword of c language you can make any variable as volatile variable. Properties of volatile variable: 1. A volatile variable can be changed by … Continue reading →

Posted in Data Structures with C | Leave a comment

Memory Layout of C Programs

A typical memory representation of C program consists of following sections. 1. Text segment 2. Initialized data segment 3. Uninitialized data segment 4. Stack 5. Heap A typical memory layout of a running process 1. Text Segment: A text segment … Continue reading →

Posted in Data Structures with C | Leave a comment

Message Queues imlementation

RCS file: sender.c,v Working file: sender.c head: 1.1 branch: locks: strict root: 1.1 access list: symbolic names: keyword substitution: kv total revisions: 1; selected revisions: 1 description: Implemented Message Queue using msgget(),msgsnd(),and msgrcv() functions. message queue is half duplex mode … Continue reading →

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

how to insert and delete elements in linked list at various position

head 1.1; access; symbols; locks root:1.1; strict; comment @ * @; 1.1 date 2014.03.27.10.47.56; author root; state Exp; branches; next ; desc @@ 1.1 log @Initial revision @ text @#include #include struct node { int data; struct node * next; … Continue reading →

Posted in Data Structures with C | Leave a comment

how to copy a string in a array..

if we want to insert the elements of a string into a array like char a[20]=”hello”; then it will show a error… because a (array name) is a constant pointer..whose address can not be changed… and here we try to … Continue reading →

Posted in Data Structures with C | Leave a comment

function pointer

we cannot define a function into a structure, but we can define a function pointer in structure.

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

mdc

instead of using while,can we use the return value of read untill it returns 0 when it returns 0,it means all the chars in string has been read. ??

Posted in Data Structures with C | Leave a comment

bitfield

2 RCS file: bitfield.c,v 3 Working file: bitfield.c 4 head: 1.1 5 branch: 6 locks: strict 7         root: 1.1 8 access list: 9 symbolic names: 10 keyword substitution: kv 11 total revisions: 1;     selected revisions: 1 12 description: 13 bits … Continue reading →

Posted in Data Structures with C | Leave a comment

BEST ways to implement C code!!!!!!!!!!!!

5.1 Formatting Your Source Code Please keep the length of source lines to 79 characters or less, for maximum readability in the widest range of environments. It is important to put the open-brace that starts the body of a C … Continue reading →

Posted in Data Structures with C | Leave a comment

HOW TO USE atoi() function for conversion of strings into integers……..

RCS file: atoi.c,v 3 Working file: atoi.c 4 head: 1.3 5 branch: 6 locks: strict 7 access list: 8 symbolic names: 9 keyword substitution: kv 10 total revisions: 3; selected revisions: 3 11 description: 12 this program tells the use … Continue reading →

Posted in Data Structures with C | Leave a comment