How many bytes are needed to store each of the following values: 'n', "n", '\n', "\n", "\\n", "" ?
-
How many bytes are needed to store each of the following values: 'n', "n", '\n', "\n", "\\n", "" ? In a C++ program?
-
Answer:
In C language 'n' is a character 1 byte "n" is a string 2 bytes which includes \0 '\n' is a character 1 byte "\n" newline plus null character 2 bytes "\\n" takes three bytes. \\ is taken as \, n, plus null character "" null character only in the string. So 1 byte.
Jada at Yahoo! Answers Visit the source
Other answers
1,2,1,2,3,1 all characters 'c' are size 1 all strings have extra 0 at the end so u add 1 the \\n is 2 characters + the extra 0 so 3
'n', in C++ it is one byte (in C it is an int 2 or 4 bytes) "n", 2 bytes 'n' and 0 '\n', one byte "\n", 2 bytes 10 ( new line ) and 0 "\\n", 3 bytes '\' ,'n', '\0' "" 1 byte 0 (or '\0' which is the same thing)
Related Q & A:
- How costly is it to renovate an old barn, into a three bedroom, water, electric n gas are within a few meters?Best solution by Yahoo! Answers
- How to cook ROAST CHICKEN n HAINANESE CHICKEN n FRIED CRISPY CHICKEN n WHITECICKEN SAMBALCHCIKEN ROAST CHICKEN?Best solution by Yahoo! Answers
- How to make my own home Music Recording Studio to record Music n songs?Best solution by Yahoo! Answers
- Which country is surrounded totally surrounded by MILLIONS n MILLIONS n MILLIONS n MILLIONS of MUSLIMS MUSLIMS?Best solution by Yahoo! Answers
- How much chlorine is needed to add to a pool?Best solution by eHow old
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.