On Thu, 9 Nov 2006, Cassio B. Caporal wrote:
Hey,I have problems to print '%' in stdout... Suppose code below: #include <stdio.h> main() { char foo[] = "bar=30%\n"; fprintf(stdout, bar); } OpenBSD returns : bar=30 Linux returns : bar=30% How can I solve this? Thanks,
Use the format specifier with fprintf: #include <stdio.h> int main() { char foo[] = "bar=30%\n"; fprintf(stdout, "%s", foo); } cc test.c ./a.out bar=30% -Matt-