h0704.c

来自「学习C语言必备的好书」· C语言 代码 · 共 39 行

C
39
字号
/* spawnl() and spawnle() example */

#include <process.h>
#include <stdio.h>
#include <conio.h>

void spawnl_example(void)
{
   int result;

   clrscr();
   result = spawnl(P_WAIT, "bcc.exe", NULL);
   if (result == -1)
   {
      perror("Error from spawnl");
      exit(1);
   }
}


void spawnle_example(void)
{
   int result;

   clrscr();
   result = spawnle(P_WAIT, "bcc.exe", NULL, NULL);
   if (result == -1)
   {
      perror("Error from spawnle");
      exit(1);
   }
}

int main(void)
{
  spawnl_example();
  spawnle_example();
  return 0;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?