-1

我正在使用 C++ 中的 nxtOSEK 对 Lego Nxt Brick 进行编程。似乎 stdlib.h 库不工作,但 string.h 库工作正常。有没有人见过这个?

我的包括

#include <string.h>
#include <stdlib.h>

我的错误

LegoQueue.cpp: In function ‘void queue::debugstring(char*)’:
LegoQueue.cpp:131: error: ‘itoa’ was not declared in this scope

尽管 itoa 的 c++ 文档 ( http://www.cplusplus.com/reference/cstdlib/itoa/ ) 明确指出 itoa 应该在 stdlib.h 中,但并未声明 itoa。任何帮助将不胜感激,谢谢。

4

1 回答 1

0

如果您将代码编译为 C++,您应该更喜欢这样编写包含指令:

#include <cstdlib>
#include <cstring>

如果有帮助,请告诉我。

于 2015-11-26T15:28:53.040 回答