我在 .c 中的 preprocessText() 函数(如下)中遇到此错误,但我不完全确定原因。从浏览来看,大多数人似乎在某个地方缺少了 { 或 ( 或 ; 等,但我相当确定我没有。
#include "string.h"
#include "stdio.h"
#include "stdlib.h"
#include "Assembler.h"
int main(int argc, char** argv) {
// ...
preprocessText(file, inter1);
// ...
}
public void preprocessText(FILE* file, FILE* file2) { //error happens at this declaration
// ...
}
我的头文件是:
#ifndef ASSEMBLER_H
#define ASSEMBLER_H
#include <string.h>
#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stddef.h>
// ...
void preprocessText(FILE* file, FILE* file2);
#endif
最佳答案
如果函数名称在作用域内,则所有方法都可以由任何其他代码段隐式访问。 c
中没有 public
关键字
关于c - 我收到错误 : expected '=' , ',' 、 ';' 、 'asm' 或 '' __attribute_ _' before ' void',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20164930/