91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 1KB
    文件類型: .c
    金幣: 1
    下載: 0 次
    發布日期: 2021-06-05
  • 語言: C/C++
  • 標簽: shell??

資源簡介

該程序是我寫的博客“一起talk C栗子吧(第七十一回:C語言實例--DIY shell)”的配套程序,共享給大家使用

資源截圖

代碼片段和文件信息

/*?**************************
?*?The?main?funtion?of?shell
?*?*************************/
#include

#define?BUF_SIZE?64

typedef?struct?_input_type
{
char?*?str;?//?the?value?of?input
int?size;???//?the?length?of?value
}input_type;

input_type?input[]?=
{
{“exit“4}
{“cd“2}
{“ls“2}
};

void?cds(const?char?*?p);
void?lss(const?char?*?p);

int?main(int?argc?char?*argv[])
{
char?buf[BUF_SIZE];
int?res?=?1;
int?flag?=?1;
int?index?=?0;

while(flag)
{
printf(“|->“);
if(NULL?==?fgets(bufBUF_SIZEstdin))
return?0;

index?=?sizeof(input)/sizeof(input_type);
while(ind

評論

共有 條評論