When trying to print the first command line argument:
std::cout << argv[0] << std::endl;
clang-tidy gives a warning:
warning: 'do not use pointer arithmetic' from [cppcoreguidelines-pro-bounds-pointer-arithmetic]
Is there an alternative way to use argv values ββwithout using pointer arithmetic? Doesn't have access to char** any reasonable method that would have to use pointer arithmetic?
I appreciate that there are some specialized functions for handling command line arguments, but they seem too heavy for the simple output of a single argument.
I write in c++ using the clang compiler and creating with cmake .
source share