ADVERTISEMENT
ADVERTISEMENT

The __LINE__ Macro Example in C | C preprocessor programs

The __LINE__ Macro Example in C: Here, we will learn how the __LINE__ Macro works in C programming language?
Submitted by IncludeHelp, on August 25, 2018

The __LINE__ is an inbuilt Macro in C programming language, it returns current line number of the code.

Example:

#include <stdio.h>

int main(){
	
	printf("Hello world\n");
	printf("Line: %d\n",__LINE__);
	printf("How are you?\n");
	printf("Line: %d\n",__LINE__);
	printf("Bye bye!!!\n");
	
	return 0;
}

Output

    Hello world
    Line: 6
    How are you?
    Line: 8
    Bye bye!!!

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.