N
Noah Roberts
I have a situation in which a function expects a char const* and uses
the supplied address directly. It's a GUI element in a particular
platform but the question is generic.
I could give it the c_str() return of the string and expect that the
string isn't going to change, if it does send the c_str() again.
I could give it &str[0].
I could use a vector and do the same as the second string method.
I could also just use a raw array but I see no real advantage in that.
From a portability or design standpoint is there any /real/ difference
in the first three choices?
the supplied address directly. It's a GUI element in a particular
platform but the question is generic.
I could give it the c_str() return of the string and expect that the
string isn't going to change, if it does send the c_str() again.
I could give it &str[0].
I could use a vector and do the same as the second string method.
I could also just use a raw array but I see no real advantage in that.
From a portability or design standpoint is there any /real/ difference
in the first three choices?