我把stdin,stdout等都设为uart,然后编写 #include <stdio.h> #include <string.h> int main (void) { char* msg = “hello world”; FILE* fp; fp = fopen (“/dev/jtag_uart”, “r+”); if (fp) { fprintf(fp, “%s”,msg); fclose (fp); } return 0; 应该是可以在niosII IDE的console上显示的啊,但结果报错了 ../hello_world.c: In function `main': ../hello_world.c:21: error: stray '\161' in program ../hello_world.c:21: error: stray '\176' in program ../hello_world.c:21: error: `hello' undeclared (first use in this function) ../hello_world.c:21: error: (Each undeclared identifier is reported only once ../hello_world.c:21: error: for each function it appears in.) ../hello_world.c:21: error: parse error before "world" (贴了一部分) 如果不能这样操作的话,那么怎么能对多个串口操作呢, |