char *p=cs.GetBuffer(20);m=atoi(p);

解决方案 »

  1.   

    >>char *p=cs.GetBuffer(20);
    >>m=atoi(p);
    需要使用cs.ReleaseBuffer(20),否则会出现leak.其实可直接用 m= atoi(cs)。
      

  2.   

    我好象见过用wsprintf 的,不记得了,谁给我个例子
      

  3.   


    int m = atoi(cs);

    int m = _ttoi(cs);
    就很好。
    不能用 wsprintf()
    可以用 sscanf(cs, "%d", &m);
    但不如用 m = atoi(s); 好。
      

  4.   

    To: eastrock(东方之石)
    不是用 sprintf(),可以用 sscanf(),建议用 atoi() 或 _ttoi()。