ADVERTISEMENT
ADVERTISEMENT

The # Preprocessor Operator Example in C | C preprocessor programs

The # Preprocessor Operator Example in C: Here, we will learn how the # operator works in C programming language.
Submitted by IncludeHelp, on August 25, 2018

The # is a preprocessor operator, which is used to convert an argument into string i.e. quoted string.

Example:

#include <stdio.h>

#define STR(X)	#X

int main(){
	
	printf("%s\n",STR(Hello world!));
	printf("%s\n",STR(How are you?));
	printf("%s\n",STR(I love programming!));
	
	return 0;
}

Output

    Hello world!
    How are you?
    I love programming!

C Preprocessors Programs »


ADVERTISEMENT



ADVERTISEMENT



Comments and Discussions


ADVERTISEMENT

ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT

Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.