Csharp Articles

Page 196 of 196

How do we use a #line directive in C#?

Samual Sam
Samual Sam
Updated on 30-Jul-2019 241 Views

It lets you modify the compiler's line number and (optionally) the file name output for errors and warnings. Let us see some examples. #line 100 "demo" int a; // CS0168 on line 100 int b; // CS0168 on line 101 int c; // CS0168 on line 102 As shown above the example reports three warnings associated with line numbers. The #line 100 directive forces the line number to be 100 and until the next #line directive, the filename will be reported as "demo”. Let’s see ...

Read More
Showing 1951–1951 of 1,951 articles
« Prev 1 192 193 194 195 196 Next »
Advertisements