Last active
August 29, 2015 14:01
-
-
Save lidio601/1074cbb6aaa65d6d1109 to your computer and use it in GitHub Desktop.
C++ Esempio tipo di dato esadecimale
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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