為什么定義char輸出不了2?
/**
? * 定義類:Student
? * 數據成員:名字、年齡
? */
struct Student
{
public:
? ? // 定義數據成員名字 m_strName 和年齡 m_iAge
? ? string m_strName;
? ? int m_iAge;? ? ? ? //為什么這里定義char沒有輸出呢?
};
/**
? * 定義類:Student
? * 數據成員:名字、年齡
? */
struct Student
{
public:
? ? // 定義數據成員名字 m_strName 和年齡 m_iAge
? ? string m_strName;
? ? int m_iAge;? ? ? ? //為什么這里定義char沒有輸出呢?
};
2021-04-03
舉報
2021-04-06
因為后面的賦值是stu.iAge=2而不是='2'