当前位置:网站首页>Visual stdio(VS)中的(int argc、char** argv)命令行参数
Visual stdio(VS)中的(int argc、char** argv)命令行参数
2022-07-26 12:36:00 【宗浩多捞】
有些程序需要输入命令行参数,一种方式在命令行中cd到exe的文件目录下,输入命令行参数
另一种就是不用找到可执行文件的目录,在VS内部进行输入:项目属性 → \to →调试 → \to →命令参数
- 需要注意一点,在VS中 argv[0] 默认为当前可执行文件的路径
- 测试一下
#include <iostream> int main(int argc, char** argv) { std::cout << "argument count: " << argc << std::endl; for (int i = 0; i < argc; i++) { std::cout << "argv[" << i << "]: " << argv[i] << std::endl; } std::cin.get(); return 0; }

边栏推荐
- Paper reading MLPD: multi label pedestrian detector in multispectral domain (Internship Program of Hikvision Research Institute)
- Detailed explanation of Legendre transformation and conjugate function
- Flutter's learning path
- LCD notes (4) analyze the LCD driver of the kernel
- Commonly used list Why does isempty() suddenly report null?
- 回溯——491. 递增子序列
- 如何以文本形式查看加密过的信息
- Ds-112 time relay
- 笔记。。。。
- Do you need to launch MES system? What are you struggling with?
猜你喜欢

Problems encountered in byte stream exercises and Solutions

STM32 drives hc05 Bluetooth serial port communication module

What is a callback function? Understanding of the word "back"

New function | intelligent open search online customized word weight model

今日睡眠质量记录75分

编程式导航路由跳转到当前路由(参数不变), 多次执行会抛出NavigationDuplicated的警告错误?

食品安全 | 微波炉什么食品都能加热?这些安全隐患要知道

How does the chain store cashier system help shoe stores manage their branches?

Ds-112 time relay

Food safety | are sterile eggs really completely sterile?
随机推荐
Detailed explanation of Legendre transformation and conjugate function
Huawei ultra fusion fusioncube solution notes
敲黑板画重点:七种常见“分布式事务”详解
.eslintrc.js configuration description
LCD notes (4) analyze the LCD driver of the kernel
Where is safe to open an account when buying stocks on mobile phones?
Sword finger offer 24. reverse the linked list
“2022华为开发者大赛中国区东部赛区开幕式”在福州成功举办
今日睡眠质量记录75分
【Map】万能的Map使用方法 & 模糊查询的两种方式
手机上买股票,在哪里开户比较安全?
In the digital era, what "golden treasure" is driving the development of pharmaceutical enterprises for a century?
14.2字节流学习
Knowledge points of C language documents
About the copy of picture address links
The map function counts the number of occurrences of characters
Interviewer: how to deal with high concurrency?
How does the chain store cashier system help shoe stores manage their branches?
如何组装一个注册中心?
Data query function