所以这是我所有的程序代码:
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
typedef struct {
unsigned char adr;
unsigned char type;
} stru;
int main (int argc, char *argv[]){
while(1){
stru data;
data.adr = 5;
data.type = 4;
printf("Address: %c, Type: %c \n", data.adr, data.type);
}
return 0;
}
我用“gcc testprog.c -o testprog”编译它。
输出如下:
Address: , Type:
Address: , Type:
Address: , Type:
Address: , Type:
Address: , Type:
Address: , Type:
Address: , Type:
Address: , Type:
Address: , Type:
Address: , Type:
Address: , Type:
^CAddress: , Type:
PuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTY^C
我在 Virtual Box 上运行 Ubuntu 12.04 并通过 PuTTY SSH 客户端访问它我最近安装了 0MQ 库,但我认为这不会导致错误。
如果有人对此有解决方案,请告诉我。谢谢你。