How can I use a variable in a system function?
i.e. I want to make a simple little program that you can put an IP address into the program and it will ping it for you. I would do something like this:
Where would I put the variable IP?Code:int main() { double IP = 0.0; cout << "Please Enter the IP Address you Wish to Ping: "; cin >> IP; system("ping"); }
Also, would the IP be a double, seeing as there are more than one decimal place?