Solved

g++ wait command

Posted on 1998-04-29
4
775 Views
Last Modified: 2013-12-26
I have wrote a while loop that reads one line at a time and sends an email to the user. I was using strcpy & strcat to move in to memory and then system(buffer) to run it. Locked up the server because it was too much all at once. I have been tring to figure out how to put a wait(seconds) command between each while loop.

I tried
wait(2);
pause(2);

What am I over looking.

Thanks in advance.
Bob Ross
0
Comment
Question by:bross073097
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 2

Accepted Solution

by:
jaked earned 50 total points
ID: 1292556
You want sleep(seconds). wait() waits for a child process to die, and pause() pauses until a signal is received.

0
 

Author Comment

by:bross073097
ID: 1292557
Thanks, I was at wit's end with this.

Bob

0
 

Author Comment

by:bross073097
ID: 1292558
I tried sleep(10);

When I compiled it g++ test.c I received

implicit declaration of function 'int sleep(...)'

What did I miss.

Thanks
Bob Ross
0
 

Author Comment

by:bross073097
ID: 1292559
I got it, I forgot to put the unistd.h #include

Thanks

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question