![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Solving the network storage dilemma - Builder AU | iBot | UNIX and Linux RSS News | 0 | 08-12-2007 10:40 PM |
| Disabling 802.3x flow control | LivinFree | IP Networking | 0 | 11-18-2006 02:33 AM |
| Flow Chart | sabari | High Level Programming | 1 | 04-12-2006 02:57 AM |
| A Terminal Dilemma | rocky_triton | UNIX for Dummies Questions & Answers | 5 | 04-13-2005 12:32 PM |
| how to assign correct control flow? | apalex | UNIX for Dummies Questions & Answers | 1 | 07-11-2001 12:10 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
dilemma in control flow
hello im facing a queer problem when i execute the foll code in unix Code:
# include <stdio.h>
# include <unistd.h>
main(int argc,char *argv[])
{
FILE *fp = fopen("/ras/chirag/fifotest/file.fifo","a");
int i=1;
fprintf(fp,argv[1]);
printf("I SLEEP");
system("date");
for (i=0;i<50;i++)
{
//printf("do nothing\n");
}
i=sleep(25);
printf("%d",i);
printf("I WAKE UP");
system("date");
fclose(fp);
}
the above code first executes the date command and then sleeps for 25 secs and then prints the strings "I SLEEP" and "I WAKE UP" in the end... the output i obtained is: Code:
Fri Feb 10 19:10:16 CST 2006 Fri Feb 10 19:10:41 CST 2006 I SLEEP0I WAKE UP can anyone help me why is such a flow occuring and what can be done to get it the normal way? thanks in advance............ |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|