EmbLogic's Blog

Category Archives: Data Structures with C

C Structure and It’s Simple Programme

1.What is Structure ? Structure is the collection of variables of different types under a single name for better handling. For example: You want to store the information about person about his/her name, citizenship number and salary. You can create … Continue reading →

Posted in Data Structures with C | Leave a comment

swaping of two value without using third variable

#include<stdio.h> int main() { int a,b; printf(“Enter the value of a:”); scanf(“%d”,&a); printf(“Enter the value of b:”); scanf(“%d”,&b); a=a+b; b=a-b; a=a-b; printf(“%d”,a); printf(“%d”,b); return 0; }

Posted in Data Structures with C | Leave a comment

sum of two arrays.

Posted in Data Structures with C | Leave a comment

Program to find the HCF and LCM of two numbers.

//HCF and LCM of two nos. #include int main() { int a,b,num1,num2,deno,nume,rem=1,lcm; printf(“\nEnter two nos: “); scanf(“%d %d”,&a,&b); if(a>b) { num1=a; num2=b; } else { num1=b; num2=a; } nume=num1; deno=num2; while(rem!=0) { rem=nume%deno; nume=deno; deno=rem; } printf(“\nHCF: %d “,nume); lcm=(num1*num2)/nume; … Continue reading →

Posted in Data Structures with C | Leave a comment

check this code out on function pointers

Posted in Data Structures with C | Leave a comment

Structure Member Alignment and structure Padding

What do we mean by data alignment, structure packing and padding? Predict the output of following program. #include <stdio.h> // Alignment requirements // (typical 32 bit machine) // char         1 byte // short int    2 … Continue reading →

Posted in Data Structures with C | Leave a comment

compresion function for 4 bit mdcaeuit

head    1.47; access; symbols; locks root:1.47; strict; comment    @ * @; 1.47 date    2014.06.08.07.52.37;    author root;    state Exp; branches; next    1.46; 1.46 date    2014.06.07.16.31.29;    author root;    state Exp; branches; next    1.45; 1.45 date    2014.06.07.16.21.15;    author root;    state Exp; branches 1.45.1.1; … Continue reading →

Posted in Data Structures with C | Leave a comment

Phony Targets, Macros and Special Characters in MAKEFILES

Sometimes a target does not mean a file but it might represent an action to be performed. When a target  is not related to a file it is called phony target. For instance: getobj: mv obj/*.o . 2>/dev/null getobj target move … Continue reading →

Posted in Data Structures with C | Leave a comment

project01–>pointers

1>>    *s++  and *(s++)   OR    *s– and *(s–) both behaves in the same manner.prints the same value. 2>> ++*s   means value print the the incremented value at pointer s.  

Posted in Data Structures with C | Leave a comment

what does a makefile contain??

A make file consists of a set of targets, dependencies and rules. A target most of time is a file to be created/updated. target depends upon a set of source files or even others targets described in Dependency List. Rules … Continue reading →

Posted in Data Structures with C | Leave a comment

points to remember about ‘extern’ in C

1. Declaration can be done any number of times but definition only once. 2. “extern” keyword is used to extend the visibility of variables/functions(). 3. Since functions are visible through out the program by default. The use of extern is … Continue reading →

Posted in Data Structures with C | Leave a comment

Whether Linked List is linear or Non-linear data structure?

Logically linked list is a linear data structure because each node has a link to its next one. but physically it is not necessarily true because memory allocation to nodes may or may not be sequential..

Posted in Data Structures with C | Leave a comment

What is the difference between Storage structure and file structure?

The representation of a particular data structure in the memory of a computer is called a storage structure whereas a storage structure representation in auxiliary memory is often called a file structure.  

Posted in Data Structures with C | Leave a comment

DIFFERENCE BETWEEN NULL ARRAY AND EMPTY ARRAY

null array—-when the size of array is not declared than the array is known as null array. EMPTY ARRAY——-if an array having the size but not values than it’s known as empty array. EX = null array b[]; empty array … Continue reading →

Posted in Data Structures with C | Leave a comment

LSEEK() system call

The lseek() function repositions the offset of the file descriptor fildes to the argument offset according to the directive whence. The argument fildes must be an open file descriptor. Lseek() repositions the file position pointer associated with the file descriptor … Continue reading →

Posted in Data Structures with C | Leave a comment