I want to print "%SomeString%"
in C.
Is this correct?
printf("%%s%",SomeString);
I want to print "%SomeString%"
in C.
Is this correct?
printf("%%s%",SomeString);
Hi,
You can print a string like this: printf("%s", SomeString);
It should work!
This solution absolves you from knowing how special printf characters like '%' or '\' should be printed.
#include <stdio.h>
int main(void)
{
const char str[]="MyString";
printf("%c%s%c",'%',str,'%');
return 0;
}