How to escape the % sign in C's printf? -


How do you avoid% while using printf in C?

  printf ("hello \%"); / * Do not like it * /  

You saved it by posting the double '%' Use this example: %%

Use your example:

  printf ("hello %%");  

The escape sign of '%' is for printf only if you do:

  four [5]; Strapepi (A, "%%"); Printf ("This is the value of one:% s \ n", a);  

It will print: This is the value of one: %%


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -