![]() |
【转帖】[求助]vs.net
[求助]vs.net
呵!终于解决问题了。 struct resbuf *join::strrealloc(struct resbuf *strbuf,tchar *word) { struct resbuf *ex; ex=entitem(strbuf,1); if(_tcslen(ex->resval.rstring)<(_tcslen(word))) //重新分配内存 ex->resval.rstring=(tchar *)realloc(ex->resval.rstring,_tcslen(word)+1); _tcscpy(ex->resval.rstring,word); return strbuf; } 将上面红色字语句改为: ex->resval.rstring=new tchar[_tcslen(word)+1]; 还应在最后一行加上:delete [_tcslen(word)+1]ex->resval.rstring; 一切ok |
| 所有的时间均为北京时间。 现在的时间是 04:23 AM. |