Questions about this topic? Sign up to ask in the talk tab.

Difference between revisions of "Template:Code"

From NetSec
Jump to: navigation, search
m
Line 5: Line 5:
  
 
=Usage=
 
=Usage=
<pre>{{code|text=your code would go here.
 
 
maybe some here too.}}</pre>
 
Would give you:
 
{{code|text=your code would go here.
 
 
maybe some here too.}}
 
 
If you want the code box to have syntax hilighting, use <nowiki><syntaxhighlight lang=""> or <source lang=""></nowiki>
 
 
 
Example:
 
Example:
  

Revision as of 03:46, 22 June 2016


Usage

Example:

{{code
|text=
<source lang="cpp">
int exampleFunction(int x, int y){
int Sum = x + y;
return Sum;
}
</source>
}}


Will give you:

 
int exampleFunction(int x, int y){
int Sum = x + y;
return Sum;
}