cout是有值的,但是delete得时候就会报错。
char *ch = new char(100);
char tmp[10] = "e100";
strtod(tmp, &ch);
cout << *ch << endl;
delete ch;
system("pause");
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
稍微看了一下strtod的代码:
然后对比一下下面两段代码:
分割线别忘了cstring!