Hi all, well basically here's the problem.
I need my ping program to read a line from a text file in the following format:
Then display the output once it has been pinged etc.Code:server_address port Example: 127.0.0.1 80
The code im using so far consists of:
Any help is appreciatedCode:#include <iostream.h> #include <windows.h> void main() { char target[50]; char pSize[5]; char cmdline[67] = "ping -t -l "; cout<<"::Pinger::\n\n"; cout<<"Enter Host Address: "; cin.get(target, 50); cin.ignore(80, '\n'); cout<<"Ping Packet Size (Maximum Of 5 Digits): "; cin.get(pSize, 5); cin.ignore(80, '\n'); strcat(cmdline, pSize); strcat(cmdline, " "); strcat(cmdline, target); system(cmdline); }![]()



LinkBack URL
About LinkBacks



