首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

!怎么对自定义类型自动补全

2013-04-21 
求助!如何对自定义类型自动补全#include iostream2 using namespace std3 class Mystring4 {5public:6M

求助!如何对自定义类型自动补全
#include <iostream>
  2 using namespace std;
  3 class Mystring
  4 {
  5     public:
  6     Mystring(char *s)
  7     {
  8         str = new char[strlen(s) + 1];
  9         strcpy(str, s);
 10     }
 11     ~Mystring()
 12     {
 13         if(str != NULL)
 14             delete []str;
 15     }
 16     void print()
 17     {
 18         cout<<str<<endl;
 19     }
 20     
 21     char *str;
 22 };
 23

int main()
{
     Mystring a("hello");
     Mystring b("world");
     a.str;          // 我想在这里输入a.的时候可以自动显示出类Mystring中的成员。
     return 0;
}
我是在linux下使用vim编写的代码。

[解决办法]
不考虑下QtCreator?
VIM建议用clang插件。

热点排行