bcd to char c code example
Example 1: bcd to char c
class Person{ private: int Code; char Name[25];
public: Person ( int Code=23, char *Name =”Unknow”);
char *GetName( ); void SetName(char *Name);
protected: void Input( ); void Output( );
};
class Employee: protected Person{
protected: int hour; float Salary; static float Rate;
public: void Indata( ); void Outdata( );
};
class Company: public Employee{
public: inline float Income( );
friend void Sort(Company a[45],int n);
friend void Del_Employee(Company obj[45],int n);
};
Example 2: bcd to char c
void BCD_To_ASCII(unsigned char bcd_value, char * p_ascii_text)
{
*p_ascii_text++ = (bcd_value >> 4) + '0';
*p_ascii_text++ = (bcd_value & 0x0f) + '0';
*p_ascii_text = '\0';
return;
}