aurelien.chanudet@gmail.com said:
[color=blue]
> Hi all,
>
> Can someone tell me about the difference between these two statements ?
>
> char *string = _("foo");[/color]
This is a function call to a function named _ which appears to accept a
const char * (or, lamely, a char *) and return a pointer to char. What
value it returns is anyone's guess. Alternatively, _ might be a macro.
[color=blue]
> char *string = "foo";[/color]
This is a definition and initialisation of a pointer to char. Its initial
value is the address of the first character in the string literal, "foo". A
better definition would be:
const char *string = "foo";
as you wouldn't want accidentally to modify the contents of a string literal
through a pointer, now would you?
--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)