Lets say... I wanted to ping an IP. I know this can be done in CMD, or C++ very easily, but lets say I want to ping it a few times without re-entering the IP or Website. I've made it loop 5 times, but how would I get the person to enter the IP or Website they wanted to ping... For example,
Doesn't work. How would I ping a variable without having to hardcode it? Thanks,Code:#include <iostream> #include <windows.h> #include <winable.h> using namespace std; int main() { char IP[9999]; int x = 0; cout<<"Enter IP or Website to ping: "; cin.getline(IP, 9999); cout<<"\n"; while (x != 5) { system("ping" IP ); x++; } return 0; }
Brad.