[GRASS-dev] po-strings für r.mapcalc

Maris Nartiss maris.gis at gmail.com
Fri Jul 20 07:45:49 PDT 2012


Just my curiosity as I'm not a good programmer (more coder than
programmer) - why using large string literal in fputs is so bad idea?

Maris.

2012/7/20 Glynn Clements <glynn at gclements.plus.com>:
>
> Maris Nartiss wrote:
>
>> You can't use function to initialize a array (string) in C (Glynn can
>> correct me, if I'm wrong).
>
> Correct.
>
> You can't use a function call to initialize static variables (i.e.
> global variables or "static" local variables) or any array (whether
> static or automatic).
>
> I was thinking about it from the xgettext side (i.e. whether xgettext
> recognises concatenated string literals split over multiple lines)
> rather than from the C side, so I completely overlooked that issue.
>
> From the C side, using:
>
>         const char *help_text = _("...");
>
> inside main() would work. That may be preferable to putting a large
> string literal inside the fputs() call.
>
> --
> Glynn Clements <glynn at gclements.plus.com>


More information about the grass-dev mailing list