求各位高手指教

liuwenfang 2004-03-27 06:11:24
char 和 string 的区别?
还有就是指针,谁能够详细的说一下。
...全文
34 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
liuwenfang 2004-04-03
  • 打赏
  • 举报
回复
谢谢了,我还要问一下,什么是指针函数,什么是函数指针
enoloo 2004-03-27
  • 打赏
  • 举报
回复
char表示一个字符。比如char a='b';
string表示一个字符串。在mfc中有CString类,在stl中有string。
比如CString a="abjgksd";

指针就是内存地址。通过指针可以访问对象。
比如
int m=14;
int* pa=&m;//m的地址
cout<<*pa<<endl;//输出m的值
WinZZ 2004-03-27
  • 打赏
  • 举报
回复
在MSDN中,这样写的:
对于char:
The keyword char identifies a data item that has 8 bits. To the MIDL compiler, a char is unsigned by default and is synonymous with unsigned char.

对于在C++中的string:
typedef basic_string<char> string;
The type describes a specialization of template class basic_string for elements of type char.

2,586

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 资源
社区管理员
  • 资源
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧