g++ wait command

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

What am I over looking.

Thanks in advance.
Bob Ross
Question by:bross073097
  • 3

Accepted Solution

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.


Author Comment

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



Author Comment

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.

Bob Ross

Author Comment

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



Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Host to IP 7 83
Expand macro to ask for filename column 8 37
Change owner from userA to server Local Administrators 7 71
wordappend challenge 8 223
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

749 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