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:
Code:
server_address port
Example:
127.0.0.1 80
Then display the output once it has been pinged etc.
The code im using so far consists of:
Code:
#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);
}
Any help is appreciated