Skip to content

Instantly share code, notes, and snippets.

@lidio601
Last active August 29, 2015 14:01
Show Gist options
  • Save lidio601/1074cbb6aaa65d6d1109 to your computer and use it in GitHub Desktop.
Save lidio601/1074cbb6aaa65d6d1109 to your computer and use it in GitHub Desktop.
C++ Esempio tipo di dato esadecimale
#ifndef _IOSTREAM_H
#include <iostream.h>
#endif
#ifndef _CONIO_H
#include <conio.h>
#endif
class hex {
private:
char *val;
int lung;
public:
//costruttori e funzioni friend
// friend int sizeof(hex a);
hex();
~hex();
//funzioni membro
hex operator=(hex *b);
};
/*
int sizeof(hex *a) {
return a->lung;
} */
hex::hex() {
this->val=NULL;
this->lung=0;
}
hex::~hex {
if(this->lung) {
delete []val;
this->lung=0;
}
}
int main() {
clrscr();
hex a=0x01;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment