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, "f:\\WINDOWS\\system32\\ipconfig.exe", "f:\\WINDOWS\\system32\\ipconfig.exe", NULL);
char ip[16];
cin >> ip;
for (int a = 1; a < 255; a++){
spawnl(P_WAIT, "f:\\WINDOWS\\system32\\ping.exe", "f:\\WINDOWS\\system32\\ping.exe", ip, a, NULL);
}
return 0;
}