Dec 1, 2013 at 1:00pm UTC
I am currently developing a program, and I forgot how to print "%d", literally, so compiler does not recognize it as an integer, is that "'%d'"? ("%d" is just example so you can know what i mean").
I am using printf or printf_s,
cout and cin.
Dec 1, 2013 at 1:09pm UTC
printf is for:
I can't say if it is used in coding
Last edited on
Dec 1, 2013 at 1:11pm UTC
Dec 1, 2013 at 1:17pm UTC
It's actually a very simple program which I write in the console (visual basic 2013) for some system calls, hoping to be helpful to everyone, most of the code I wrote I just miss the above problem.
I will go try with " ' ' " and see if it works.
Dec 1, 2013 at 1:54pm UTC
You simply have to "escape" the '%' with another '%' sign. This would give the following:
printf("To print an integer, use %%d \n");
Topic archived. No new replies allowed.
General C++ Programming
© cplusplus.com, 2000-2017 - All rights reserved -
Spotted an error? contact us