Monday, July 6, 2009

Strings: Single Quote Vs Double Quotes

In UNIX Shell
============
Double Quotes : In (Most ) UNIX shells and other scripting languages like perl, the interpreter would parse through the string inorder to perform substitutions for any variables in the string.

Single Quotes: Interpreter leaves the string alone. It is treated as a string literal.


In C
===========
Double Quotes: For strings

Single Quotes : For single character literals.

e.g

char c[];
c = 'c'; ==> SINGLE Quotes
c = "char"; ==> DOUBLE quotes


No comments: