等 C++ 高手!!

来源:百度知道 编辑:UC知道 时间:2024/05/14 11:58:38
#include <adoint.h>
#include <atlbase.h>
#include <adoint.h>

void bstr_realloc() {

BSTR foo = SysAllocString(L"abc"), bar;
wchar_t *baf = L"abc", *x = L"xyz";
foo = SysReAllocString(&baf, x);
foo = SysReAllocString(&foo, bar);
}
int main()
{
return 0;
}
这段代码 我只想给他编译通过就行 但总是报错 高手能不能帮我改改 让他在编译时顺利通过呢 我要求他实现什么 只要编译通过! 谢谢

给,已经改好了,在VC++6.0上编译通过

#include <stdio.h>
#include <string.h>
void bstr_realloc() {

char foo[4] = "abc", bar[4];
char baf[4] = "abc";
char *x = "xyz";
strcpy(baf,x);
strcpy(foo,bar);
}
int main()
{
return 0;
}