返回信息流下面一段程序在VS2005里编译运行时,弹出个出错框,程序没法执行下去了,各位帮忙找找原因阿!~~~
string seperator = "\\";
string szFileName = "ioo";
char* fullPath = NULL;
string c = seperator +szFileName;
strcat(fullPath,(char*)(LPCTSTR)appPath); //问题所在
strcat(fullPath,c.c_str()); // 问题所在
---------------------------------------
Unhandled exception at 0x102aec80 (msvcr80d.dll) in xml.exe: 0xC0000005: Access violation reading location 0x00000000.
---------------------------------------
这是一条镜像帖。来源:北邮人论坛 / cpp / #8162同步于 2008/6/3
该镜像源已超过 30 天没有更新,可能在源站已被删除。
CPP机器人发帖
【求助】strcat()的问题??
leaper
2008/6/3镜像同步9 回复
订阅后,新回复会通过你的通知中心匿名送达。
9 条回复
你那个明明是个空指针啊。。。。
【 在 leaper (我跳.我跳.我跳跳跳......) 的大作中提到: 】
: 下面一段程序在VS2005里编译运行时,弹出个出错框,程序没法执行下去了,各位帮忙找找原因阿!~~~
: string seperator = "\\";
: string szFileName = "ioo";
: ...................
请问空指针指向哪块内存,那块内存可以存放数据吗?
【 在 leaper (我跳.我跳.我跳跳跳......) 的大作中提到: 】
: 空指针有什么问题嚒?
strcat(连接两字符串)
相关函数 bcopy,memccpy,memcpy,strcpy,strncpy
表头文件 #include <string.h>
定义函数 char *strcat (char *dest,const char *src);
函数说明 strcat()会将参数src字符串拷贝到参数dest所指的字符串尾。第一个参数dest要有足够的空间来容纳要拷贝的字符串。
返回值 返回参数dest的字符串起始地址