EmbLogic's Blog

Category Archives: Uncategorized

structure padding

Most processors require specific memory alignment on variables certain types. Normally the minimum alignment is the size of the basic type in question, fo instance this is common   char variables can be byte aligned and appear at any byte … Continue reading →

Posted in Uncategorized | Leave a comment

To print master array

#include<stdio.h> #include<string.h> #include<fcntl.h> int main() { int i,j,fd,len,maslen=1; char arr[100]={0}; char masterarr[25]={0}; fd=open(“add.c”,O_RDONLY); i=0; while(read(fd,&arr[i],1)) i++; len=strlen(arr); for(i=0;i<len;i++) { for(j=0;j<maslen;j++) { if(j+1==maslen) { masterarr[j]=arr[i]; maslen++; break; } else { if(masterarr[j]==arr[i]) break; } } } printf(“masterarr=%s\n”,masterarr); return 0; }

Posted in Uncategorized | Leave a comment

how union differ from the structure!!!

#include<stdio.h> union abc { char a; int b; int c; }z; int main() { printf(“size of union %d\n”,sizeof(union abc));//the size of the union is the maximum size of the data type. z.a=4; printf(“the value for a is %d\n”,z.a); z.b=5; printf(“***********************after … Continue reading →

Posted in Uncategorized | Leave a comment

Different ways to make and use the structures in C language.

#include<stdio.h> 2 3 4         struct 5         { 6                 char a; 7                 int b; 8                 int c; 9         }d;//as d is the variable of the structure and this is the structure without its name that’s why we can’t make the further     … Continue reading →

Posted in Uncategorized | Leave a comment

Comparison

Comparison between different processors currently in use.

Posted in Uncategorized | Leave a comment

Use of fopen(), fgetc() and fputc().

#include<stdio.h> #include<fcntl.h> #include<unistd.h> int main(int argc,char *argv[]) { FILE *fd1, *fd2; char ch;int i; fd1=fopen(argv[1],”r”);//the read file is to be read from command line arguments.(as this is the high level programming because in this we are using the fopen instead … Continue reading →

Posted in Uncategorized | Leave a comment

package installation from cd

how to change yum configuration?? we want gcc package installation from cd using yum.

Posted in Uncategorized | Leave a comment

ftp configuration

check if package is already present or not by using rpm -q vsftpd    (as the rpm package for ftp is vsftpd) if not present then yum install vsftpd yum y install after that service vsftpd start    

Posted in Uncategorized | Leave a comment

pipe

DISCRIPTION-> Pipe-> it is a unidirectional channel that is used in inter process commmunication ,in pipe two file discriptor is used these are fd(0)=read & fd(1)=write RETURN VALUE-> on success zero is returned,if error -1 is returned  

Posted in Uncategorized | Leave a comment

Write a C Programme that does not terminate when Cntrl+C is pressed

Write a C program that doesn’t terminate when Ctrl+C is pressed. It prints a message “Cannot be terminated using Ctrl+c” and continues execution. We can use signal handling in C for this. When Ctrl+C is pressed, SIGINT signal is generated, … Continue reading →

Posted in Uncategorized | Leave a comment

USB DEVICE CONTROL THROUGH NTERNET

In this project I have controlled a USB device through internet using a web browser. The device could be used to control multiple device connected to the USB device. The project involved configuring Apache server(alongwith SElinux configuration for apache),writing CGI … Continue reading →

Posted in Uncategorized | Leave a comment

ipc prjct with one process

1 2 RCS file: server.c,v 3 Working file: server.c 4 head: 1.1 5 branch: 6 locks: strict 7         root: 1.1 8 access list: 9 symbolic names: 10 keyword substitution: kv 11 total revisions: 1;     selected revisions: 1 12 description: 13 … Continue reading →

Posted in Uncategorized | Leave a comment

Making the IPC by using the pipe in the sync way.

RCS file: server.c,v Working file: server.c head: branch: locks: strict access list: symbolic names: keyword substitution: kv total revisions: 0 description: this is the server getiing the message from the requesting client and deliver the message to the procedural client. … Continue reading →

Posted in Uncategorized | Leave a comment

Database Using Pipes

RCS file: server.c,v Working file: server.c head: 1.10 branch: locks: strict akshat: 1.10 access list: symbolic names: keyword substitution: kv total revisions: 10; selected revisions: 10 description: IPC PROJECT Creating a server that stores information of employes. Table of employe … Continue reading →

Posted in Uncategorized | Leave a comment

this is a program tyo copy the contents of one file into another

RCS file: 8p7.c,v Working file: 8p7.c head: 1.1 branch: locks: strict access list: symbolic names: keyword substitution: kv total revisions: 1; selected revisions: 1 description: this is a program to copy the contents of one file to another —————————- revision … Continue reading →

Posted in Uncategorized | Leave a comment