[cairo] char* vs. unsigned char*

Oleg Smolsky oleg.smolsky at pacific-simulators.co.nz
Mon Apr 4 14:06:11 PDT 2005


Hello Carl,

Carl Worth wrote on Tuesday, 5 April 2005:
> Now that I've grumbled a bit, I need to put the few necessary casts
> in, and also decide which types cairo should export. So I'm looking
> for recommendations as to which types we should have in the interface.
I believe that everything to do with actual C zero-terminated strings
should be "char" and "const" eg:
    void some_cairo_function(const char *font_name);

This way I can invoke it from C++ and use an instance of std::string:
    some_cairo_function(sFontName.c_str());

or even an MFC string that implements "operator const char*()":
    some_cairo_function(sFontName);

Best regards,
Oleg.




More information about the cairo mailing list