Print a string without using quotes anywhere in the program using C or C++.
Note : should not read input from the console.
The idea is to use macro processor in C (Refer point 6 of this article). A token passed to macro can be converted to a string literal by using # before it.
This article is contributed by Vignesh. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
- C program to print characters without using format specifiers
- ispunct() function in C
- Anything written in sizeof() is never executed in C
- strspn() function in C
- Difference between while(1) and while(0) in C language
- lvalue and rvalue in C language
- A shorthand array notation in C for repeated values
- Write a C program to print "GfG" repeatedly without using loop, recursion and any control structure?
- Print Hello World without semicolon in C/C++
- Execute both if and else statements in C/C++ simultaneously
- Print "Hello World" in C/C++ without using any header file
- Write your own memcpy() and memmove()
- How to write a running C code without main()?
- Interesting Facts about Macros and Preprocessors in C
- Write a C program to print "Geeks for Geeks" without using a semicolon