Marking up code

You can mark up code by enclosing it in appropriate shortcodes. I have installed the syntax highlighter plugin so that keywords should be highlighted appropriately.

  • The C Language

    	 	 
    [c]	 	 
    #include <stdio.h>	 	 
    main()	 	 
    {	 	 
    	printf("Hello World");	 	 
    }	 	 
    [/c]	 	 
    

    becomes

    	 	 
    #include <stdio.h>	 	 
    main()	 	 
    {	 	 
    	printf("Hello World");	 	 
    }	 	 
    
  • Java

    	 	 
    [java]	 	 
    class hello	 	 
    {	 	 
    	public static void main(String args[])	 	 
    	{	 	 
    		System.out.println("Hello World!");	 	 
    	}	 	 
    }	 	 
    [/java]	 	 
    

    becomes

    	 	 
    class hello	 	 
    {	 	 
    	public static void main(String args[])	 	 
    	{	 	 
    		System.out.println("Hello World!");	 	 
    	}	 	 
    }	 	 
    
  • C++

    	 	 
    [cpp]	 	 
    #include	 	 
    int main()	 	 
    {	 	 
    	std::cout << "Hello World!" << std::endl;	 	 
    	return 0;	 	 
    }	 	 
    [/cpp]	 	 
    

    becomes

    	 	 
    #include	 	 
    int main()	 	 
    {	 	 
    	std::cout << "Hello World!" << std::endl;	 	 
    	return 0;	 	 
    }	 	 
    
  • Shortcodes for use with many other languages are listed here.

    Leave a Reply