Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 Netbeans 工作,用 C++ 编程,但我有一个问题:我的程序在视觉上运行完美,但是一旦我将它复制到 Netbeans,strlenand strcpy(字符串库的函数)就不起作用。
strlen
strcpy
编译器说:
unable to resolve identifer strlen error: 'strlen' was not declared in this scope.
我已经做到了#include <string>。
#include <string>
有任何想法吗?
你搞好了没
#include <cstring> or #include <string.h>
还要检查 gcc 或 cygwin 编译器是否正确配置了 netbeans
除了使用
#include <cstring>
还要确保你已经把
using namespace std;
或者
using std::strlen; using std::strcpy;
提前你的程序