Can't use System commands

So, as far as I can tell, this code should run a system command from the C++ program:

system("ping 192.168.1.2 /t /l 32768");

However, I just keep getting a "system Was not declared in this scope" error message. Is there something wrong with this?
Last edited on
system() is a function of the cstdlib (C++) / stdlib.h (C) so you have to include this library in your code.

# include <cstdlib>

For a good explanation see at:

http://www.cplusplus.com/reference/cstdlib/system/?kw=system
Last edited on
Topic archived. No new replies allowed.