c-编译代码:未知类型名称字符串



我有以下几行代码,但编译器在函数的声明和定义中都说:"未知类型名称‘string’"。怎么了?

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void fRecognizeClient(string *ActualClient)

c中没有字符串类型。您需要使用这样的数组:

char array[10];

然后你可以把它传递给你的函数:

void fRecognizeClient(char *ActualClient);

在C++中,没有类型"string"。尝试使用容器类std::string<string>报头。

最新更新