Qt 项目在调试中,报此问题。
Invalid parameter passed to C runtime function.
我所遇到的是空指针传递给 c 库函数导致的。
调用了 atoi(const char*)
modelInfo.type=atoi(modelElement->Attribute("type"));
但是传入的Attribute()
函数的原型是这样:
/** Given an attribute name, Attribute() returns the value
for the attribute of that name, or null if none exists.
*/
const char* Attribute( const char* name ) const;
导致有可能传入一个 null
给 atoi
函数。