64位程序连接了mitab_i.lib
当程序中出现两个字符串相加
string a = "hello" + "World!"
就会崩溃

解决方案 »

  1.   

    这个都编译不过去的代码,指针不能相加。
    字符串相加需要其中一个为string类型
    string a = string("hello") + "World!";

    string a ="hello" +  string("World!");
      

  2.   


    编译不过楼主能运行吗??在其它环境编译和运行都没问题的
    不知道你用什么编译器能编译通过?VS2008
    #include<string>
    using namespace std;
    int main()
    {
    string a = "hello" + "World!";
    }
    error C2110: “+”: 不能添加两个指针
      

  3.   


    编译不过楼主能运行吗??在其它环境编译和运行都没问题的
    不知道你用什么编译器能编译通过?VS2008
    #include<string>
    using namespace std;
    int main()
    {
    string a = "hello" + "World!";
    }
    error C2110: “+”: 不能添加两个指针
    哦,我看错了。
    //这样
    string a = "hello"      "World!";
    //或者
    string a = "hello"
              "World!";
    //都可以编译通过的
      

  4.   

    当 txt 很长时 可以 
    string a = "hello"
                  "World!"
                  “How are you?“
    所有 引号 内 的 字符串 会 合并 在一起!