Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with program and how to do it

Status
Not open for further replies.

glitch003

Programmer
Jan 6, 2003
9
US
i need help with this program that im working on. the program is supposed to ping all IPs in a range, so i know the IPs of the active computers(this is not going to be used for hacking, but for scanning my wi-fi network). im trying to use a for loop for this but im having some problems... help me if u can..heres the code:


Code:
#include <stdio.h>
#include <iostream.h>
#include <process.h>
#include <conio_mingw.h>
#include <stdlib.h>
#include <windows.h>
int main(int argc, char *argv[])
{
 spawnl(P_NOWAIT, &quot;f:\\WINDOWS\\system32\\ipconfig.exe&quot;, &quot;f:\\WINDOWS\\system32\\ipconfig.exe&quot;, NULL);
  char ip[16];
  cin >> ip;

for (int a = 1; a < 255; a++){

    spawnl(P_WAIT, &quot;f:\\WINDOWS\\system32\\ping.exe&quot;, &quot;f:\\WINDOWS\\system32\\ping.exe&quot;, ip, a, NULL);

      }

  return 0;
}
 
Mmmm.

And your problems are?

--
William
Software Engineer
ICQ No. 56047340
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top