社区
C++ 语言
帖子详情
cstring s.format(_T("%s",sname); s没值。为什么。
honghufuwei
2007-04-18 10:26:10
cstring s.format(_T("%s",sname); s没值。为什么。
我在VS2005下。
char sname[];
sname有值/
...全文
337
10
打赏
收藏
cstring s.format(_T("%s",sname); s没值。为什么。
cstring s.format(_T("%s",sname); s没值。为什么。 我在VS2005下。 char sname[]; sname有值/
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
10 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
dadatech
2007-04-18
打赏
举报
回复
CString s.Format("%s", "xxx");
竟然能编译过啊?我想想啊:)
。。。。。。
事实证明是编译不过的,楼主能告诉我你认为上面的句子到底表达啥意思呢?定义变量?执行Format?s从那里来的?
finalwei
2007-04-18
打赏
举报
回复
cstring s = _T("");
s.format("%s",sname);
我觉得编译也不会过啊。分开写看看
lidongri
2007-04-18
打赏
举报
回复
cstring s.format(_T("%s",sname);
---
cstring s;
s.format(_T("%s",sname);
honghufuwei
2007-04-18
打赏
举报
回复
format 里面的是%S不是%X,那是我刚改的。
honghufuwei
2007-04-18
打赏
举报
回复
zmfile *zmfile1;
zmfile1=(zmfile*)m_buf1;
doinfo.filelen=zmfile1->filelen;
char sDrive[_MAX_DRIVE];
char sDir[_MAX_DIR];
char sFname[_MAX_FNAME];
char sExt[_MAX_EXT];
assert(zmfile1->name);
_splitpath_s(zmfile1->name, sDrive, sDir, sFname, sExt);
strcat_s(sFname,sExt);
CString fname.Format(_T("%x"),sFname);
zmfile1->name的值是:D:\webLogicITRS\web\files\temp\eclipse-SDK-3.2-win32.zip
SFname 也有值:eclipse-SDK-3.2-win32.zip
就是FORMAT后,fname 的值是空的。
晨星
2007-04-18
打赏
举报
回复
把前后的代码多帖几行吧,我觉得应该是小问题。
honghufuwei
2007-04-18
打赏
举报
回复
大哥什么意思,我的编译通过了。可就是S没值
jixingzhong
2007-04-18
打赏
举报
回复
编译都过不料才对.....
CString s.Format(_T("%s"),sname);
honghufuwei
2007-04-18
打赏
举报
回复
s.Format(_T("%s"),sname);
晨星
2007-04-18
打赏
举报
回复
cstring s.format?
T("%s",sname)?
VC中BSTR、Char*、C
String
和CComBSTR类型的转换
1、char*转换成C
String
若将char*转换成C
String
,除了直接赋值外,还可使用C
String
::
format
进行。例如:char* p = "This is a test"; 或C
String
the
String
= p;the
String
.
format
("%s", p);the
String
= p;2、C
String
转换成char*若将C
String
类转换成char*(LPSTR)类型,常常使用下列三种方法:方法一,使用强制转换。例如:C
String
the
String
( "This is
解决“const char[]类型没有+操作符“问题
MFC的Unicode字符集对(const char A + "") 字符串的+加号重载功能,不稳定,改用str.
Format
("%s%s", strA,strB)来实现2个字符串之间的连接。
自定义扩展MessageBox(
Format
ted MessageBox/AfxMessageBox)
int MyMessageBox(TCHAR *szCaption, TCHAR *sz
Format
, ...) { TCHAR buf[1024]; va_list pArgList; va_start(pArgList, sz
Format
); _vsntprintf(buf, sizeof(buf), sz
Format
, pArg
PCI Express Architecture Configuration Space Test Specification Revision 5.0, Version 1.0 (CB).pdf
PCI Express Architecture Configuration Space Test Specification Revision 5.0, Version 1.0 (CB).pdf
【计算机硬件接口】PCI规范中的Class Code与Capability ID分配:设备功能分类及扩展能力标识系统设计
内容概要:本文档为PCI-SIG发布的《PCI Code and ID Assignment Specification》版本1.4,发布于2013年8月,主要定义了PCI设备的类代码(Class Codes)、能力标识(Capability IDs)以
C++ 语言
65,212
社区成员
250,514
社区内容
发帖
与我相关
我的任务
C++ 语言
C++ 语言相关问题讨论,技术干货分享,前沿动态等
复制链接
扫一扫
分享
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++
技术论坛(原bbs)
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
请不要发布与C++技术无关的贴子
请不要发布与技术无关的招聘、广告的帖子
请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下
试试用AI创作助手写篇文章吧
+ 用AI写文章