Strings

I have the following string to print
"cagty %c5 gty"
I want to print it but replacing the %c5 bit with "999".
Can anyone tell me hoje to do it in c programming.
Thanks
You can use the function `printf` from the stdio.h library.

The result you request:
printf("cagty %d5 gty", 999);

Reference for further information:
http://www.cplusplus.com/reference/clibrary/cstdio/printf/
Last edited on
Thanks for your reply.

I was not very clear and I am sorry for that. C5 is the Hex of a character in UTF-8 (197 in ascii extended.
What I want is to replace %c5 by the corresponding character in UTF8 format.
Can you help on that.
Oh I see, and the result of that would actually be C5, so you can know if the code is correct...
Well, It's not a problem, all you have to do is convert ASCII to UTF-8 before displaying.
I would have helped more and provide code and everything I can, but I don't know how to convert between ASCII to UTF-8, but I think I gave you an idea about how to do this.
Topic archived. No new replies allowed.