#include "stdafx.h"
#include <iostream>
#include
#include
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
unsigned char* chararr = new unsigned char[256];
// ... asigno valores al array de caracteres...
string str;
str.assign((char*)chararr);
cout << "Look, I'm writting string values";
cout << str << "\n";
cout << "Look, I'm writting hexadecimal values";
for (unsigned long i = 0; i < 256; i++)
printf("%02X ", chararr[i]);
printf("\n");
}
No hay comentarios:
Publicar un comentario