c - 执行不启动程序
问题描述
我有两个程序,其中一个通过 execl 调用另一个,但它没有启动。
这是调用程序:
#include <stdio.h>
#include <unistd.h>
int main(int argc, int *argv[])
{
printf("Program %s executes", argv[0]);
execl("hello", " ", "Hello", "World!", NULL);
return 0;
}
“你好”程序:
#include <stdio.h>
int main(int argc, char *argv[])
{
int i=1;
printf("%s\n",argv[0]);
printf("Program started and got string : ");
while(argv[i++] != NULL)
printf("%s ",argv[i]);
return 0;
}
解决方案
推荐阅读
- laravel - 如何在 Laravel 中使用 Accessor 作为条件?
- c - 带有 Windows Mobile 5.0 SDK 的 WIN32 C 程序:无法使用 time_t 显示当前日期和时间
- javascript - 没有数组的循环组件
- python - 如何使用服务帐户和 python 上传文件
- python - 有没有更简洁的方法从 python 列表创建对?
- tensorflow - 如何初始化函数“tf.keras.layers.prelu”
- sql - 使用 SQL Server 中的值将列设置为侦听器
- python - Python:从网站的表中获取数据
- javascript - 如何根据条件更改轮播中的背景颜色
- oracle - 在 oracle 数据库中插入 BLOB 数据时出错