Don't open console output with system() [duplicate]
Possible Duplicate:
Hide console in C system() function, Win.
Hi guys I have a little problem, I need to ping a lot of PC, so in my program i call the function system() with "ping -n 1 > tmp.txt", but I don't want that the console window is shown.
How can I do it?
P.S.: I use dev c++ :D
thx
It is fairly hard to do this cleanly.
A better approach might be to google "ping.c" and choose one of the many implementations, then rip the guts out of it and make your own ping function. This will be faster and give you more control.
I found what you might be looking for here Hide a window in C++
And also here I guess the freeconsole() method is what you are needing?
See this question :
Hide console in C system() function, Win
精彩评论