Solved

g++ wait command

Posted on 1998-04-29
4
769 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
  • 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
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.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

825 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