25 Aug
2009
25 Aug
'09
8:56 a.m.
Steven Watanabe wrote:
AMDG
Steve Nolen wrote:
I know the c standard calls for the argv in main's prototype to be non-const, but why can't parse_command_line be more restrictive?
Because it that case, you won't be able to pass main's argv to parse_command_line.
ok why not? you would be passing a non-const (main::argv) to a const qualified parameter. this would just guarantee that the function couldn't modify it (which is what you're telling me is the case here). i thought this was allowed.
No. The standard allows conversion from char* to const char*, but not from char** to const char**.
But it allows conversion from char** to const char* const*.