EmbLogic's Blog

Functions

Functions assignment now completed

Posted in Data Structures with C | Leave a comment

what is meaning of “i+1″ in pf statment

#include
#define MONTHS 12
int main()
{
int days[MONTHS]={31,28,[4]=31,30,31,[1]=29};
int i;
for(i=0;i<MONTHS;i++)
printf("%2d %d\n",i+1,days[i]);
return 0;
}

Posted in Uncategorized | Leave a comment

Implementation of CVS and RCS

Both CVS and RCS have been implemented successfully.

Posted in Project Management Tools | Leave a comment

To run any command on system boot

I found it only 4 fedora 14…

just put the command in a file called /etc/rc.local

or put in /etc/rc.d/rc.local

or write a script in /etc/init.d/

and reboot the system…. that command will work.

Still searching a common method for all the versions of fedora.. if anyone know it.. plz let me know..

thank you

 

Posted in Linux Internals and System Programming | Leave a comment

Pointers

Pointers assignment almost complete with two three problems

Posted in Data Structures with C | Leave a comment

this program on pipes is not wroking , can anyone tell me why ??

#include
#include
#include

int main()
{
char buff[10];
char tx[]=”hello wor\n”;
int fd[2],t;
pid_t pd;
printf(“\n %s”,tx);

pipe(fd);
pd = fork();
if (pd == 0 )
{
printf(“\n parent cerated : %d”,getpid());
close(fd[0]);
write (fd[1],tx,sizeof(tx));
}
else if(pd == 1)
{
printf(“\n child cerated : %d”,getpid());
close(fd[1]);

printf(“\n %s”,buff);
read(fd[0],buff,sizeof(buff));
printf(“the received string is :%s”,buff);
}
return (0);

}

Posted in Linux Internals and System Programming | Leave a comment

what’s going on here????printing x=1 and y=1

#include<stdio.h>
int main()
{
int x=1,y=1,z;
if(y<0) if(y>0) x=3;
else x=5;
printf(“%d\n”,x);
printf(“%d\n”,y);
return 0;

Posted in Uncategorized | 1 Comment

both are printing same?????

 i=l=f=d=100/3;
printf(“%.8g\t”,(double)i);
printf(“%.8g\t”,(double)f);
printf(“%.8g\t”,(double)d);
d=f=l=i=100/3;
printf(“%.8g\t”,(double)i);
printf(“%.8g\t”,(double)f);
printf(“%.8g\t”,(double)d);

Posted in Uncategorized | Leave a comment

output is 2 1 1.how??//

#include<stdio.h>
int main()
{
int x,y,z;
x=y=z=1;
++x||++y&&++z;
printf(“%d\t%d\t%d\n”,x,y,z);
return 0;
}

Posted in Uncategorized | Leave a comment

3rd printf() is printing 4 why????

#include<stdio.h>

int main()

{

int x=2,y,z;

x*=3+2;

printf(“%d\n”,x);

x*=y=z=4;

printf(“%d\n”,x);

x=y==z;

printf(“%d\n”,x);

return 0;

}

Posted in Uncategorized | 3 Comments