How to store MAC Address in a variable in C++

  • Thread starter Thread starter Shahzaib17
  • Start date Start date
S

Shahzaib17

Guest
i want to store the mac address in a variable retrieved from the code in the for loop mentioned below

char MacAddr[6];
ULONG size = sizeof(MacAddr);
char jk;
SendARP(inet_addr(argv[1]), inet_addr(ipv4.c_str()), MacAddr, &size);
//std::cout << "Ipv4 is: "+ipv4;
std::cout << "\nThe MAC address is: ";
for (unsigned char c : MacAddr)
std::cout << std::setw(2) << std::setprecision(2) << std::setfill('0') << std::hex << (unsigned)c << " ";


Continue reading...
 
Back
Top