First of, consider char*
to mean c_string
, and it immediately becomes obvious why you would need int main(int argc, c_string argv[])
versus int main(int argc, c_string& argv)
. After all, programs can take more than one parameter.
Since an array of references (if it were allowed) would turn out to hold only a single char per index, since references cannot be used to find the next character (without taking the reference of it, and thus converting it to a pointer), this does not make any sense either.
The assumption that the array of arguments is not owned by the program is simply false. The C standards 1999 and 2011 explicitly say:
The parameters argc and argv and the strings pointed to by the argv array shall be modifiable by the program, and retain their last-stored values between program startup and program termination.
And my copy of the C++1y standard draft says nothing to the contrary.