int l=strlen(m);
mName[l+1]='\0';

解决方案 »

  1.   

    mName=new char(l+1)
    mName为一个char,赋初值l+1
      

  2.   

    mName = new char(l + 1); // new“一个”char字符,值为(l + 1)
    mName = new char[l +1]; // new 一个char字符串
      

  3.   

    char *strcpy( char *strDestination, const char *strSource );
    "strDestination" must a arry virable,It's not a virable!
    mName=new char[l+1]
      

  4.   

    mName = new char(l + 1); // new“一个”char字符,值为(l + 1)
    mName = new char[l +1]; // new 一个char字符串
      

  5.   

    mName=new char(l+1) -> mName=new char[l+1]
      

  6.   

    The first argument, strDestination, must be large enough to hold strSource and the closing '\0'; otherwise, a buffer overrun can occur.
      

  7.   

    char *m="http:/www.dfasdfadsfadsfadsfadsfdsaf.com...";这种写法是很危险的,在程序设计中是不允许出现的
      

  8.   

    mName=new char[l+1]
    strcpy(mName,m)