gpt4 book ai didi

c++ - GoogleTest 通过引用初始化

转载 作者:行者123 更新时间:2023-11-28 00:07:26 26 4
gpt4 key购买 nike

是什么原因,为什么GoogleTest对参数计数使用引用?

  testing::InitGoogleTest(&argc, argv);

(我的意思是:据我了解,这是一个输入参数,没有任何区别是否提供了值或地址)

最佳答案

参见 comments .

// Initializes Google Test.  This must be called before calling
// RUN_ALL_TESTS(). In particular, it parses a command line for the
// flags that Google Test recognizes. Whenever a Google Test flag is
// seen, it is removed from argv, and *argc is decremented.

关于c++ - GoogleTest 通过引用初始化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34752224/

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