0

I wonder if anyone can tell me how the code tags works? As per my understanding does it works like:

MY CODE HERE.....

for the enitre block of code? or I need to do this for every line of code?

3
Contributors
8
Replies
9
Views
7 Years
Discussion Span
Last Post by maverick405
0

For the entire block of code indeed.

Then how the text color are applied to the code? I mean which code and what will be the syntax to apply color to the code in the block?

0

Then how the text color are applied to the code? I mean which code and what will be the syntax to apply color to the code in the block?

It's magic!
Example:

int number = 0;
cout << "hello" << number << '\n';

now the exact same text but in [code]

[/code] tags:

int number = 0;
cout << "hello" << number << '\n';

Voila! Syntax-highlighting!

0

Why do we use this? Voila! Syntax-highlighting!

Edited by Nick Evan: n/m

1

Why do we use this? Voila! Syntax-highlighting!

"Voila! Syntax-highlighting!" isn't part of the code tag. niek_e is just excited by the power of code tags and decided to spread the enthusiasm. Feel free to replace "Voila! Syntax-highlighting!" with :cool::cool::cool:

Votes + Comments
:)
0

Because it makes the code easier to read? All major IDE's have syntax-highlighting. What IDE/compiler are you using?

0

Because it makes the code easier to read? All major IDE's have syntax-highlighting. What IDE/compiler are you using?

I am using Dev-C++

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.