| kingpulse (5) | |
|
Hey guys so I am wanting people to be able to input an Ip. Though I can't seem to get a data type to hold an Ip. I want to be able to do something like this. #include <iostream> using namespace std; #define NL '\n'; (something) ipadress; int main() { cout << "Please enter the ip"; cout << NL; cin >>ipadress; cout << NL; cout << "Your ip adress you entered is " << ipadress; cout << NL; return 0; } So I have tried using Int and char but they don't work :(. I also tried using string though it turns out they cant have input to them from a cin. Well atleast I can't figure it out :D. Anyway it would be really nice if you guys could help me out. Cheers KingPulse | |
|
|
|
| coder777 (2550) | |||
you need to #include <string> in order to use it:
Please use code tags: [code] Your code[/code]See: http://www.cplusplus.com/articles/z13hAqkS/ | |||
|
|
|||