gpt4 book ai didi

c++ - TCHAR* envp[] : What is it?

转载 作者:IT老高 更新时间:2023-10-28 23:00:34 26 4
gpt4 key购买 nike

我用 Visual Studio 创建了一个 VC++ 控制台项目,它自动生成了这个函数:

int _tmain(int argc, TCHAR* argv[], TCHAR* envp[]) { ... }

我只是想知道 envp 代表什么以及如何/何时可以/应该使用它?

谢谢!

最佳答案

上面的 envp 参数将存储环境变量。

The envp array, which is a common extension in many UNIX® systems, is used in Microsoft C++. It is an array of strings representing the variables set in the user's environment. This array is terminated by a NULL entry. It can be declared as an array of pointers to char(char *envp[ ]) or as a pointer to pointers to char(char **envp). If your program uses wmain instead of main, use the wchar_t data type instead of char. The environment block passed to main and wmain is a "frozen" copy of the current environment.

Source

关于c++ - TCHAR* envp[] : What is it?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3054235/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com