// testtest.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "iostream.h"
#include "stdlib.h"
#include "string.h"
typedef char* pChar;
class tName
{
char* name;
int data;
public:
tName()
{
name=NULL;
data=0;
}
tName(char *str,int i)
{
name=(char*)malloc(strlen(str)+1);
strcpy(name,str);
data=i;
}
~tName()
{
if(name)
free(name);
}
operator int()
{
return data;
}
operator pChar()
{
return name;
}
};
int main(int argc, char* argv[])
{
tName tname("Tom",10);
int k=tname;
cout<<k<<" "<<(pChar)tname<<endl;
return 0;
}