i have successfully completed scull read and write with multiple item at application level .
i have successfully done multiple data com. and decom. (bit code length=4).
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
#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
#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
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
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
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
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
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
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
how could the compiler compile the following statement z >= y >= x ? 1 : 0