1.const char* p: p is a pointer to const char(char const* p 一样) 意思就是不能通过p指针来修改p指向的内容(但是内容可以修改). 2.char* p : p is a pointer to char 意思就是可通过p指针来修改p指向的内容 3.char* const p: p is a const pointer to char 意思就是p指针是一个常指针,他指向的内存地址不能变,定义的时候就得初始化 一旦给…
转: const char to LPCTSTR不能转化问题 Visual C++ 2008里cannot convert parameter 1 from 'const char [13]' to 'LPCTSTR'造成不能运行的原因主要是2005和2008中增加了一些参数类型的安全性检查,所以通常在6.0没有问题的LPCTSTR与 const char之间的转换到了这里就玩不转.微软给出的解决办法有两个: Change your project configuration to use mu…
How to convert a std::string to const char* or char*? 1. If you just want to pass a std::string to a function that needs const char* you can use std::string str; const char * c = str.c_str(); If you want to get a writable copy, like char *, you can d…