您的位置:首页 > 其它

typedef字符型指针的字符串使用

2015-09-02 17:19 260 查看
刚来报到,刚接触编程时不会使用字符串,发现字符char的指针能指示字符串。纪念我的编程时代的开始~

int main()
{

typedef char *pstring;
const pstring cstr = "abcd";
const pstring *ps = &cstr;
decltype (cstr) ci ="efgh";

std::cout << cstr[2] << ","<< *ps <<","<< ci<< std::endl;
system("pause");
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  字符串