我用c++ console application 编程序
但是遇到了非常烦恼的问题
原来在vb下面功能强大的 string 字符串命名方法不能用!!!不是默认关键字!!!
也就是说,我想储存一个字符串时,只能用 char a[] 的方法把字符串弄成数组!!!
太麻烦了!!!!!!
还有,这样进行字符串比较时也太难了!!!!!!!诸位有没有好办法啊!!!!!!
大家教教我谢谢!!!!!!没有办法来鼓励我的也给分!!!!!

解决方案 »

  1.   

    创建时在向导中可以选择
    An application that support MFC
      

  2.   

    VC里面也有字符串的类,不过是MFC库的(CSting),功能绝对强大啦标准C和C++都是没有字符串类的,其实字符数组也不是很麻烦啊~~~大同小异。
    此外还可以用字符指针
      

  3.   

    Here:std::string: 
    this is a Standard C++ Class wrapping a char string. It is part of the Standard Template Library, or STL.
      

  4.   

    #include <string> //注意要加头文件
    #include <iostream>using namespace std ;int main()
    {
       string s1;
       cout << "Enter a sentence (use <space> as the delimiter): ";
       getline(cin,s1, ' ');
       cout << "You entered: " << s1 << endl;;
    }
      

  5.   

    比较字符串很方便啊,strncmp(),strcmp()。