F
Friedrich Dominicus
My first thought was -- strange -- but while lookng at it it has some
merits. The code looks like this
char *foo = "abcdef";
and we have a function which the following signature
void bar(char* some_foo) {
}
Then the code was called like this:
bar(&foo[0]);
I thought, why would anyone write that code instead of
bar(foo);
but after a while I was thinking it's quite good at documentation. the
& suggests that we are talking about some address, this information is
not that obvious while calling the later form.
What do you think?
Regards
Friedrich
merits. The code looks like this
char *foo = "abcdef";
and we have a function which the following signature
void bar(char* some_foo) {
}
Then the code was called like this:
bar(&foo[0]);
I thought, why would anyone write that code instead of
bar(foo);
but after a while I was thinking it's quite good at documentation. the
& suggests that we are talking about some address, this information is
not that obvious while calling the later form.
What do you think?
Regards
Friedrich