answersLogoWhite

0

Depends on several factors:

  • number of bytes per character: 1 to 4 depending on which alphabet and character encoding you use. 1 byte per character for US-ASCII and the most common Western Europe encodings.
  • length of the string: bytes per character times number of characters
  • programming language: in C, the string takes up no more space than the characters do. In many other languages, there is an additional fixed overhead for the string object itself. For example in Java, a string takes 2-4 bytes plus the space taken by the characters.
User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

How many bytes take to the integer in c language?

2


How many bytes take an integer variable in C under windows?

A plain integer variable in C under windows is 2 bytes in 16 bit windows, and 4 bytes in 32 bit windows.


How many bytes are required to store the name Bill?

4 - one for each character. However, depending on the computer language being used, there is some "overhead" - for example, with "C", the end of a text string is indicated with a null character, so "Bill" would need 5 bytes. Other languages precede strings with their length, the length taking 2, 4 or 8 bytes.


How many bytes are there for a plus b plus c?

It completely depends the datatype that you have assigned for the variables 'a' , 'b' , and 'c'. Check the compiler that you are using for the size of the datatype in bytes. Add them and thus you will get the answer.


How many bytes in a const int?

The storage size of an int in C is loosely defined, and may be either 2 bytes or, more commonly, 4 bytes. Whether or not it is defined as const won't affect the size.


What is stream in c?

it is a sequence of bytes


How many bytes does an Boolean take in a c program?

There is no boolean in C, we usually use int/short/char to store logical values.


What is the difference between a C plus plus string and a C-style string?

A std::string is an object that encapsulates an array of type char whereas a C-style string is a primitive array with no members. A std::string is guaranteed to be null-terminated but a C-style string is not.


How many MB is 5205488 Bytes?

Depending on context a megabyte (MB) can be defined as: a) 1,048,576 bytes (10242) for computer memory b) 1,000,000 bytes for computer storage. The IEEE Standards Board has determined that "Mega will mean 1,000,000" c) In rare cases it is used to mean 1000×1024 (1,024,000) bytes. So depending on context, 5205488 Bytes can equate to: a) 4.96 MB b) 5.20 MB c) 5.08 MB


What is the c string in voilin?

There is no C string on a violin- the strings are G, D, A and E. Perhaps you are thinking of a viola, which has a low C string, alongwith a G, D and an A string.


Integers need how many bits to stored in C plus plus?

It depends on the type of integer (such as long, short, int and char) and the specific implementation of C++. The only guarantee is that a char must occupy one byte (sizeof(char)==1). An int is typically 32-bits (4 bytes), but only sizeof(int) can tell you for sure.


C plus plus library functions for string operations?

You can use "string" class in C++ for string operations or you may use c style string functions as well. #include <string> String class in C++ provides all basic function to operate on strings. you may details descriptin at http://www.cplusplus.com/reference/string/string/