0
我想逐行读取文本文件内容并分配给我的变量。我怎样才能做到这一点 ?我会写在C并且不应该有'\ n'字符。从文本文件到变量逐行读取
文本文件的内容:
9600
502
N
1
8
N
变量
int baudrate;
int port;
char parity;
char databits;
char stopbit;
while (fgets(line, sizeof(line), file)) {
printf(line);
}
指定该语言。 –