[cairo] Cairo tutorial

Craig Ringer craig at postnewspapers.com.au
Sat Jul 7 23:55:25 PDT 2007


Kalle Vahlman wrote:
> 2007/7/7, Nis Martensen <nis.martensen at web.de>:
>> There are two problems:
>>
>>   1.  I cannot get any text-related code to work. My test program
>>       (based on the C example in the FAQ) is this:
> [snip]
>>     13          cairo_text_extents_t *te;
> 
> 1. You don't declare variables in the middle of functions in C, that's
> a C++ thing.

It's perfectly fine if you're going to be relying on a modern compiler
that's been updated for c99.

Personally I find declaring variables on first use much more readable
and maintainable, but it's not actually important like it is in C++
(where initializing a variable can be _expensive_).

--
Craig Ringer


More information about the cairo mailing list