Hey.When I do this:
char *suit = "Hearts"; cout<<*suit; it prints Hearts;
But in this case: It is only printing "m". WHY?
#include "stdafx.h"
#include <iostream>
using namespace std;
class yup{
public:
yup(char *);
void print();
private:
char *name;
};
yup::yup(char *x)
{
name = x;
}
void yup::print()
{
cout<<*name;
cout<<endl;
}
int _tmain(int argc, _TCHAR* argv[])
{
yup t("missak");
t.print();
return 0;
}