Mania++
 All Classes Functions Variables Pages
Hex.h
1 #ifndef HEX_H_
2 #define HEX_H_
3 
4 //* Hex
8 class Hex
9 {
10 public:
20  static void Print(char message[], int messageLength)
21  {
22  std::cout << std::hex;
23  for(int i = 0; i < messageLength; i++)
24  {
25  std::cout << (unsigned int)(unsigned char)message[i] << " ";
26  }
27  std::cout << std::dec << std::endl;
28  }
29 
37  static void Print(char* data)
38  {
39  int dataLength = strlen(data);
40  char dataResponse[dataLength];
41  memcpy(&dataResponse, &data, dataLength);
42  Hex::Print(dataResponse, dataLength);
43  }
44 };
45 
46 #endif // HEX_H_
static void Print(char message[], int messageLength)
Prints char array as hexadecimal values.
Definition: Hex.h:20
Utility to print char arrays/pointers as hexadecimal values.
Definition: Hex.h:8
static void Print(char *data)
Prints char pointer as hexadecimal values.
Definition: Hex.h:37