Warning: unknown conversion character type '' in format when using dprintf

I get a warning from this compiler (gcc 4.5):

Formatter.cpp:23: warning: unknown conversion type character '"' in format 

And this is my code on line 23:

 dprintf (fd, "<svg width=\"100%\" height=\"100%\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">"); 

Can someone determine what I am doing wrong and what triggers the warning?

+7
c
source share
1 answer

You need to avoid all occurrences of % - the printf family of functions considers them as format specifiers and tries to parse the next character (for example, as in %s ). You avoid doubling them ( %% ).

+14
source share

All Articles