小编Nik*_*son的帖子

用GCC编译Ada

我正在尝试使用编译该Calculator.ada文件gcc -c Calculator.ada并收到错误warning: Calculator.ada: linker input file unused because linking not done-我试图查找解决方案并下载可能会为我编译此文件的其他内容,但尚未弄清楚。

这里是Calculator.ada

--
-- Integer calculator program.  Takes lines of input consisting of
-- <operator> <number>, and applies each one to a display value.  The
-- display value is printed at each step.  The operator is one of =,
-- +, -, *, /, or ^, which correspond to assign, add, subtract, multiply
-- divide, and raise, respectively.  The display value …
Run Code Online (Sandbox Code Playgroud)

gcc ada

1
推荐指数
1
解决办法
2757
查看次数

C - 将CD添加到Shell

我正在关注Silberschatz,Galvin和Gagne的操作系统概念第9版.我已经完成了第3章的第一个项目,他们要求我们创建一个UNIX Shell和History Feature.我已经创建了一些,我相信的历史和大多数shell命令(pwd,date,cal等) - 我现在正在尝试添加cd到列表中,并且Segmentation fault (core dumped)当我cd在shell中使用时,我得到了一个.我觉得这不是很难实现,你只需要把pwd它换掉,无论你走到哪里.这是我的代码:

//Enter command 'history' for history feature and CTRL - c to exit the 'osh>' shell 
/*Header files */
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <wait.h>

#define MAX_LINE 80 /* The maximum length of a command */
#define BUFFER_SIZE 50
#define buffer "\n\Shell Command History:\n"

//declarations
char history[10][BUFFER_SIZE]; //history array to store history commands
int count = 0;
char *gdir, …
Run Code Online (Sandbox Code Playgroud)

c shell

-3
推荐指数
1
解决办法
816
查看次数

标签 统计

ada ×1

c ×1

gcc ×1

shell ×1