本帖最后由 shentao17792 于 2010-01-21 11:31:37 编辑

解决方案 »

  1.   


        char* buff = new char[20];
        char *bp = buff;
        int index = 10;
        bp += index; // 相当于指针,向右移index位// 这两个操作写法不同-,-
    char* buff=new char[20];
    char *buff=new char[20]; 
      

  2.   

    char* buff=new char[20]; 
    char *bp=buff; 
    int index=10; 
    bp+=index; 
    这是一个指针移动,结果为bp指向buff[9]
      

  3.   

    bp+=index; //只是进行指针偏移而已
    char*和char *在定义时是一样嘚
      

  4.   

    bp 不是char只是char的指针。指针+int是指针偏移
    char+int 结果是个int