EmbLogic's Blog

Author Archives: Sweety Hooda

head 1.1; access; symbols; locks emblogic:1.1; strict; comment @ * @; 1.1 date 2014.06.21.06.46.49; author emblogic; state Exp; branches; next ; desc @create a module.. using module_init and module_exit system calls.. then insert and delete the module from the list … Continue reading

Posted in Character Driver | Leave a comment

introduction to semaphore and initialization of semaphore..

Semaphores are a programming construct designed by E. W. Dijkstra in the late 1960s. Dijkstra’s model was the operation of railroads: consider a stretch of railroad in which there is a single track over which only one train at a … Continue reading

Posted in Uncategorized | Leave a comment

file i/o(changing the existing password in a file )

#include <stdio.h> #include <string.h> #include <stdlib.h> int main() { char *pwd=NULL; char *pwd1=NULL; int ch=0,i=0,ret,len; char *buff; pwd=malloc(sizeof(char) *10); pwd1=malloc(sizeof(char) *10); buff=malloc(sizeof(char) *10); FILE *fptr = NULL; fptr=fopen(“hello.txt”,”r+”); if(fptr == NULL) { perror(“fopen”); return -1; } else printf(“file is opened … Continue reading

Posted in Uncategorized | Leave a comment

file i/o(open a file which contains passwords and login by matching the password entered by user.)

#include<stdio.h> #include<string.h> #include<stdlib.h> int main() { char *pwd=NULL; int ch=0,i=0,ret; char *buff; pwd=malloc(sizeof(char) *10); buff=malloc(sizeof(char) *10); FILE *fptr = NULL; fptr=fopen(“hello.txt”,”r+”); if(fptr == NULL) { perror(“fopen”); return -1; } else printf(“file is opened successfully\n”); printf(“enter the password\n”); gets(pwd); ch=getc(fptr); while(ch!=EOF) … Continue reading

Posted in Uncategorized | 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

linklist

The following code inserts a node after an existing node in a singly linked list. The diagram shows how it works. Inserting a node before an existing one cannot be done directly; instead, one must keep track of the previous … Continue reading

Posted in Uncategorized | Leave a comment