EmbLogic's Blog

Category Archives: Data Structures with C

status of scull.

i have successfully completed scull read and write with multiple item at application level .

Posted in Data Structures with C | Leave a comment

status of multiple data com. & decom.

i have successfully done multiple data com. and decom. (bit code length=4).

Posted in Data Structures with C | Leave a comment

problem regarding to scull

I create the scull of item size 12 Bytes(qset=3,quantum=4), in that when i perform write operation only first 12 bytes are write and remaining are discarded means only one item wrote and item size is not increased. I am confusing … Continue reading →

Posted in Data Structures with C | 2 Comments

scull for adding one item……………….. try on gcc it may require some modification

#include<stdio.h> #include<stdlib.h> #include<sys/types.h> #include<sys/stat.h> //#include<fcntl.h> //#include<unistd.h> #include<string.h> #define QSET 3 //size of the pointer array ,points to quantum. #define QUANTUM 4 //size of quantum. struct scull_dev { struct scull_qset *data; //points to scull qset int qset; //qset size int quantum; … Continue reading →

Posted in Data Structures with C | 1 Comment

for finding substring into the sentance u can get idea by this program…………

#include <stdio.h> int find_substr(char *listPointer, char *itemPointer); int main(void) { if(find_substr(“C is fun”, “is”) != -1) printf(“Substring is found.”); else printf(“not found”); return 0; } /* Return index of first match of itemPointer in listPointer. */ int find_substr(char *listPointer, char … Continue reading →

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

related c

difference b/w structure and union. Structure: 1. It allocates memory equal to sum of memory allocated to its each individual member. 2.each member have their own memory space. 3. structure can not  be implemented in shred memory. 4. it has … Continue reading →

Posted in Data Structures with C | 1 Comment

No of words in a sentence

Pgm to find the no of  occurance of a word in a sentence. int main() { char str1[80],str2[20],str3[20]; int i=0,j,count=0; printf(“Enter the sentence:\n”);gets(str1); printf(“Enter the word for which no of occurance needs to be checked:\n”);gets(str2); while(str1[i]!=”) { for(j=0;str1[i]!=’ ‘;j++,i++) str3[j]=str1[i];   … Continue reading →

Posted in Data Structures with C | Leave a comment

in scull

how can i free memory after reading data for item, by free system call or delete the linking between qsets. i use free system call it give me segmentation fault error

Posted in Data Structures with C | 2 Comments

how to know the size of our program ………….?

Posted in Data Structures with C | 1 Comment

EOF ignored when we opened file as handler

how i can remove my garbage data when i read file with the chunks of four bytes each times, problem is occured at the eof , because it ignored it when we opened file as stream by using handler

Posted in Data Structures with C | Leave a comment

Linked List

The following code is meant to create a Linked List. The code is running  and it shows no error. Is this the correct way of creating a linked list….???? 1 2 3 #include<stdio.h> 4 #include <stdlib.h> 5 struct node 6 … Continue reading →

Posted in Data Structures with C, Uncategorized | 3 Comments

Query in Assignment 2 : Q14

In Q14, I’m reading the input through scanf. // scanf(“%c”,&arr[i]); in a while loop. The problem is it is taking two characters for a single character entered. I guess it is even taking ‘Enter’ / Carriage return as a input … Continue reading →

Posted in Data Structures with C | 2 Comments

operators

how could the compiler compile the following statement z >= y >= x ? 1 : 0

Posted in Data Structures with C | 3 Comments