answersLogoWhite

0

sizeof('3') returns 1 - its the size of a char sizeof("3") returns 2 - its the size of two chars - '3' and '\0' sizeof(3) returns 4 - its the size of an int (in a 32 bit system)

User Avatar

Wiki User

16y ago

What else can I help you with?

Related Questions

Can you use both single quotes and double quotes for strings in php?

Yes, you can use both single quotes (' ') and double quotes (" ") for defining strings in PHP. However, the choice between single and double quotes depends on whether you need to include variables or special characters within the string. Single quotes treat everything as a literal string, while double quotes allow for variable interpolation and escape sequences.


What is the difference between single quotes and double quotes?

in programming, single quotes are for characters, and double quotes are for string, but in php, javascript, html, css i don't see any difference between the two.


Why are double quotes used in C programming?

In C programming, double quotes are used to indicate String literal. char *s = "Hello World"; Where as single quotes are used to indicate a single character. char x = 'a';


What is the difference between single quotes and double quotes in PHP?

There's not too much of a difference. Most people prefer using double quotes because of the fact that you can do this: <?php $var2 = "Look at {$var1}!"; ?> which you can't do the {} thing with single quotes. You would have to do <?php $var = 'Look at '.$var1.'!'; ?>


Do single-quoted string literals have any characteristics difference from those of double-quoted string literals?

The literals with single quotes are Characters and can have a width of only one. Ex: 'y' or 'a' etc Strings cannot be declared using single quotes. They have to be declared with double quotes.


. In PHP you can use both single quotes ( ' ' ) and double quotes ( ) for strings?

In PHP, both single quotes (' ') and double quotes (" ") can be used to define strings, but they have different behaviors. Single-quoted strings treat the content literally, meaning any special characters (like \n or $variable) are not interpreted. In contrast, double-quoted strings allow for variable interpolation and special character interpretation, making them more versatile for dynamic content. This distinction is important when deciding which type of quotes to use based on the desired string behavior.


Are you allowed to make a question on Answers.com?

Yes, of course! Everyone is allowed to ask a question to Answers.com so long as it fits our site guidelines and Terms of Use. Visit the Related Link to the Help Center for information on how to ask a question.


In PHP you can use both single quotes ( ' ' ) and double quotes ( ) for strings?

You can use single quotes $variable = 'string'; You can use double quotes $variable = "string"; You can use the Heredoc method $variable = <<<EOT Very Long String EOT; And you can use the Nowdoc method (after PHP 5.3.0) $variable = <<<'EOT' Very Long String EOT;


In linux What is the difference between single quotes and double quotes with respect to shell interpretation?

Double quotes allow changes to the text string, including: -- substitution for variable names, such as $x; -- expansion of special characters, such as '*' or '?' within file names; -- command execution within backticks, such as "You have `ls | wc -l` files" Single quotes enclose an explict string, and prevent most of these changes.


What are character constants?

A character constant is a single character in the host's character set, such as 'A', 'a', '0', '%', etc. Note the use of the single quotes instead of double quotes. (Double quotes are used for string constants, not character constants.) A character constant maps to a specific int (integer) value, but assuming anything about that relationship is non-portable.


Why is h2co3 written in inverted commas?

There is no reason that h2co3 should be written inside of single quotation marks according to chemistry style guides. Single quotes are used for quotes within double quotation marks.


Is thank you is a NOT a character constant?

No, "thank you" is not a character constant. In programming, a character constant is a single character enclosed in single quotes, such as 'a' or '5'. "Thank you" is a string constant because it consists of multiple characters enclosed in double quotes.