EmbLogic's Blog

Category Archives: Data Structures with C

Some important things about segments…

1. The address of variables stored in data segment never changes. 2. All the functions are allocated memory in data segments whether it is defined inside main(locally) or outside main(globally). 3. Initialized global variables are stored in data segment, UN-initialized … Continue reading →

Posted in Data Structures with C | 3 Comments

Segment for command line arguments.??

In which segment does a command line argument goes…??

Posted in Data Structures with C | 1 Comment

Message Queues

Message queues with multiple client server implemented

Posted in Data Structures with C | Leave a comment

Why C is showing c+2 after coming back form the macro call…???

#include #define max(a,c,b) a=(b>c)?b:c void max1(int,int,int); int main() { int a=1,c=5,b=4; max(a,c++,b++);//It will make b=5 and c=7.. ?? printf(“By Macro %d\n”,a); printf(“now a= %d\nb= %d\nc=%d\n”,a,b,c); max1(a,b++,c++); return 0; } void max1(int a,int b,int c) { a=(b>c)?b:c; printf(“%d \n”,a); }

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

command line arguments

int main(int argc,char *argv[]) why  size of string which each pointer in argv[] array point is of 4 bytes irrespective of sizeof string??

Posted in Data Structures with C | Leave a comment

memory allocation by malloc

int num = 10; ptr  = malloc(sizeof(int)* number); if memory is allocated like this then the any input statement(scanf,gets,fgets) is not running , compiler jumps these stmts whyyy??

Posted in Data Structures with C | Leave a comment

free(start);

NODE *start : pointer pointing to starting of link list. after free(start) how compiler is accessing whole link list??

Posted in Data Structures with C | Leave a comment

Functions

Functions assignment now completed

Posted in Data Structures with C | Leave a comment

Pointers

Pointers assignment almost complete with two three problems

Posted in Data Structures with C | Leave a comment

problem in data structre

when using strlwr and strupr,  error come “undefined reference to strupr” i have used #include<string.h> but of no use what to do now?

Posted in Data Structures with C | 1 Comment

Shell Script Assignment 2

Shell Script assignment 2 now completed and uploaded

Posted in Data Structures with C | Leave a comment

problem with malloc()

if i write while(1) { i=(int *)malloc(sizeof(int)); } here each location will be assigned to i after 16 addresses.  But why…???  o_O

Posted in Data Structures with C | 1 Comment

strlwr, strupr header file?

when using strlwr and strupr,  error come “undefined reference to strupr” i have used #include<string.h> but of no use what to do now?

Posted in Data Structures with C | 3 Comments

what does the following code do..??

while((c=getchar())==’\n’); NOTE that there is a semicolon at the end.

Posted in Data Structures with C | 4 Comments

Assignment status

Shell assignment 1,2 complete. C assignment 1,2,3,4 complete. Facing some problem in string manipualtion in one question. Thank you

Posted in Data Structures with C | Leave a comment