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 firstname.lastname@example.org. 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.
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- C/C++ program to find the size of int, float, double and char
- Program to print last 10 lines
- C Program to print environment variables
- Program to print a pattern of numbers
- C Program to print numbers from 1 to N without using semicolon?
- C Program to print Floyd's triangle
- C Program to print contents of file
- Program to print the diamond shape
- Program to print Happy Birthday
- Program to Print Mirrored Hollow Parallelogram
- C program to print characters without using format specifiers
- Program to print half Diamond star pattern
- C program to print digital clock with current time
- Program to print hollow pyramid and diamond pattern
- Program to print hollow rectangle or square star patterns
- Write a C program to print "GfG" repeatedly without using loop, recursion and any control structure?
- C program to find the length of a string
- Program to Reverse a String using Pointers
- C program to check if a given string is Keyword or not
- C program to copy string without using strcpy() function