This'll work. You've tagged this as C++ so I've scrupulously avoided the shorter solution that's possible using the sscanf
C method. using namespace std
is used here only to shorten the quoted code.
#include <iostream>
#include <sstream>
main() {
unsigned char octets[6];
unsigned int value;
char ignore;
using namespace std;
istringstream iss("10:10:0F:A0:01:00",istringstream::in);
iss >> hex;
for(int i=0;i<5;i++) {
iss >> value >> ignore;
octets[i]=value;
}
iss >> value;
octets[5]=value;
// validate
for(int i=0;i<sizeof(octets)/sizeof(octets[0]);i++)
cout << hex << static_cast<unsigned int>(octets[i]) << " ";
cout << endl;
}