char **args can just mean you have a pointer which points to an address, and at that address, you can get a second address. Follow the second address, there is a char saved there.
On the other hand, char *args[] means " follow this address to find a list of characters".
@racketlauncher831 As far as the C compiler is concerned, there is literally no difference between those two notations. If you declare a function parameter as an array (of T), the C compiler automatically strips the size information (if any) and changes the type to pointer (to T).
(And if we’re talking humans, then char *args[] does not mean “follow this address to find a list of characters” because that’s the syntax for “array of pointers”, not “pointer to array”.)
I personally think that C++ can be beautiful. For example: std::filesystem::path overrides the / operator, for specifying parent paths. It’s the same as Kotlin’s OKIO and Pythons standard pathlib.
@affiliate Hey, you didn’t even mention that
char *args[]
actually meanschar **args
in a parameter list.It could, but not necessarily.
char **args
can just mean you have a pointer which points to an address, and at that address, you can get a second address. Follow the second address, there is achar
saved there.On the other hand,
char *args[]
means " follow this address to find a list of characters".@racketlauncher831 As far as the C compiler is concerned, there is literally no difference between those two notations. If you declare a function parameter as an array (of T), the C compiler automatically strips the size information (if any) and changes the type to pointer (to T).
(And if we’re talking humans, then
char *args[]
does not mean “follow this address to find a list of characters” because that’s the syntax for “array of pointers”, not “pointer to array”.)god, what a beautiful language. it brings a tear to my eye
I personally think that C++ can be beautiful. For example:
std::filesystem::path
overrides the/
operator, for specifying parent paths. It’s the same as Kotlin’s OKIO and Pythons standard pathlib.