A collection of programming & webdesign
Single and double quotes

Whereas in some programming languages it doesn't matter if you use single or double quotes, it matters highly in C++ (and some others, such as Java, also). For example, if you're a webdeveloper and write a function in JavaScript, you can even mix them and it will still work and give you the right output (as long as you don't use single ones at the beginning and doubles at the end of the same string). Look at the example - there are three times where a string is used and everywhere you can either use single or double quotes:

Example JavaScript:

<p id="test"></p>

function myFunction(text) {
  return text + "!";
document.getElementById("test").innerHTML = myFunction('Wow');

In C++ single and double quotes have a strictly different meaning and usage:

Single quotes are for characters only:

char myChar = 'C';

Double quotes are for strings only:

string myString = "hello world";

So, if you try to print a string on the screen using single quotes, it will still run, but will print a number:

std::cout << 'Hello World' << endl;
// prints 1869769828
// The reason for this is that the character constant is too long for its type.