Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "ip.h"
- #include "octet.h"
- #include <string>
- IP::IP(Octet a1, Octet a2, Octet a3, Octet a4)
- {
- Octet partie1, partie2, partie3, partie4;
- partie1 = a1;
- partie2 = a2;
- partie3 = a3;
- partie4 = a4;
- }
- IP::~IP()
- {
- //dtor
- }
- std::string IP::ToBits()
- {
- std::string rep = partie1.ToBits() + "." + partie2.ToBits() + "." + partie3.ToBits() + "." + partie4.ToBits();
- return rep;
- }
- int IP::getOct1()
- {
- return partie1.getOctet();
- }
- int IP::getOct2()
- {
- return partie2.getOctet();
- }
- int IP::getOct3()
- {
- return partie3.getOctet();
- }
- int IP::getOct4()
- {
- return partie4.getOctet();
- }
Advertisement
Add Comment
Please, Sign In to add comment