📄 10-3.c
字号:
#include <stdio.h>
#include <string.h>
int main(void)
{
char buf[256];
FILE * fp = popen("./calculator", "w");
if ( fp == NULL) {
printf("Fail to poen ./calculator...\n");
exit(-1);
}
while (1) {
printf("Enter a expression: ");
fgets(buf, 256, stdin);
if (strncmp("quit", buf, 4) == 0) {
fprintf(fp, "\n");
fflush(fp);
pclose(fp);
exit(0);
}
fprintf(fp, "%s", buf);
fflush(fp);
sleep(1);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -