- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Single quotes vs. double quotes in C or C++
45 Lectures 4.5 hours
66 Lectures 5.5 hours
In C and C++ the single quote is used to identify the single character, and double quotes are used for string literals. A string literal “x” is a string, it is containing character ‘x’ and a null terminator ‘\0’. So “x” is two-character array in this case.
In C++ the size of the character literal is char. In C the type of character literal is integer (int). So in C the sizeof(‘a’) is 4 for 32bit architecture, and CHAR_BIT is 8. But the sizeof(char) is one byte for both C and C++.
- Single and Double Quotes in Perl
- Is there a PHP function that only adds slashes to double quotes NOT single quotes
- What is the difference between single and double quotes in python?
- Print newline in PHP in single quotes
- How to escape single quotes in MySQL?
- Find records with double quotes in a MySQL column?
- How to insert records with double quotes in MySQL?
- CSS quotes Property
- Triple Quotes in Python
- How to print double quotes with the string variable in Python?
- What do single quotes do in C++ when used on multiple characters?
- Escaping/encoding single quotes in JSON encoded HTML5 data attributes
- Using MySQL keywords in a query surrounded with single quotes?
- How to insert date in single quotes with MySQL date formats?