#include<iostream>
#include<cstring>
#include<string>using namespace std;
int main()
{
 cout<<"_______Main() Start_______"<<endl;
  wchar_t *str;
 str=new wchar_t[4];
 wcscpy(str,"c++");
 delete [] str;
 cout<<"_____End Main()________"<<endl;
 }

解决方案 »

  1.   

    main函数需要返回值,
    最后一行加个return 1;
      

  2.   

    #include<iostream>
    #include<cstring>
    #include<string>
    #define UNICODE
    int main()
    {
     cout<<_TEXT("_______Main() Start_______")<<endl;
      wchar_t *str;
     str=new wchar_t[4];
     wcscpy(str,_TEXT("c++"));
     delete [] str;
     cout<<_TEXT("_____End Main()________")<<endl;
     }
    楼主,是这个意思吗?
    不晓得你想干什么,随便改了
      

  3.   

    最后还有一个:
    return TRUE;
      

  4.   

    wcscpy(str,(wchar_t *)"c++\0");
      

  5.   

    wcscpy(str,"c++");
    格式转换有误
     
      

  6.   

    wchar_t *str;
     str=new wchar_t[4];
     wcscpy(str,"c++");
    请问这三行什么意思?
    wchar_t是什么数据格式?
      

  7.   

    我查了一下MSDN,知道其大概意思了,不过这是在
    STDDEF.H, STDLIB.H中declared,是否要included
      

  8.   

    @ whs1980(知秋一叶) 
    -----------------
    谢谢。错了,我是用了下面的代码,提示的错误是一样的:==================
    #include<iostream>
    #include<string>
    #define UNICODE
    #include<TCHAR.H>
     
    using namespace std;int main()
    {
     cout<<_TEXT("_______Main() Start_______")<<endl;
      wchar_t *str;
     str=new wchar_t[4];
     wcscpy(str,_TEXT("c++"));
     cout<< str<<endl;
     delete [] str;
     cout<<_TEXT("_____End Main()________")<<endl;
     return 0;
    }
      

  9.   

    @EnochShen(小疯子:真的好菜—知耻而后勇!)
    -----------------------
    错了。我使用了下面的代码:#include<iostream>
    #include<cstring>
    #include<string>using namespace std;
    int main()
    {
     cout<<"_______Main() Start_______"<<endl;
      wchar_t *str;
     str=new wchar_t[4];
    //wcscpy(str,"c++");
    wcscpy(str,(wchar_t *)"c++\0");
     cout<< str<<endl; ///////////////////////这行错了,没有输出字符“C++”
     delete [] str;
     cout<<"_____End Main()________"<<endl;
     }
      

  10.   

    昏,第一次为了5分回复2次.ostream是byte streamcout<< (char*)str<<endl;