answersLogoWhite

0

Because the null character represents the end of the string.

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

Which programming language uses a string of 1s and 0s?

You, as a programmer, can use a string with 1s and and 0s (or any other content) in each and every programming language.


Why is c string defined as an array?

Every programming language treats strings as arrays. A C string is defined as being a null-terminated array of characters. A C string that does not have a null-terminator is just an array of character values, but without a null-terminator the onus is upon the programmer to keep track of the array's length.


Is every terminating decimal an integer?

No, it is not.


How do you traverse a comment and find a particular symbol within the comment?

This would require parsing, and is very language specific. The manual method would involve determining how long the comment was and then reading every single character and comparing it to the desired character until it is found (or not found). Many programming languages have methods used to locate a character or set of characters within a string, but this is very language specific.


What is the purpose of the head string pool in a programming language and how does it impact memory management?

The purpose of the head string pool in a programming language is to store and manage commonly used string literals in memory. This helps reduce memory usage by reusing the same string objects instead of creating new ones every time they are used. This can improve memory management by reducing the amount of memory allocated for storing duplicate string literals, leading to more efficient use of memory resources.


Can a non-terminating decimal be a non-repeating decimal?

Yes. Every irrational number has a non-terminating, non-repeating decimal representation.


Every terminating or repeating decimal represents a rational number and can be changed to a what?

Every rational number can be expressed as a fraction


What character is used to begin a comment?

This is different in different programming languages. Some character groups used in various languages to start a comment are: //, ;, !, /*, --, #, ', {, <!--, {-, etc. Some languages also require a character group to end a comment. Some older languages did not use character groups to mark comments but required them to appear in a certain place on every program line. There are endless variations in how commenting is done in computer programming languages.


Replace a character by another character in a given string?

C SolutionTo replace a single, specified character with another in a given string, one possibility is ...char *pszString; /* pointer to string */int offset; /* offset of desired character */... initialize pszString and offset*(pszString+offset) = 'A'; /* or whatever new value you want */Obviously, this is a simple example, and it does not consider if offset is greater than the size of the array.If you want to replace every occurence of a character with another, here is another possibility, one that also handles string length ...char *pszString; /* pointer to string */char* pszTemp; /* temporary scanning pointer */char cOldChar; /* character to change */char cNewChar; /* new character */... initialize pszString, cOldChar, and cNewCharfor (pszTemp = pszString; *pszTemp != '\0'; pszTemp++) { /* scan */if (*pszTemp == cOldChar) *pszTemp = cNewChar; /* conditionally replace */}Java Solution// Replace all 'e' characters with 'i' characters in String strstr.replaceAll("e", "i");


Is 2.322232223. a rational number?

Yes- every terminating or repeating decimal number is rational.


Does every non-terminating decimal represent an irrational number?

No; if the non-terminating decimal repeats then it represents a rational.Examples:0.3333... = 1/30.428571428571... = 3/70.181818... = 2/11


Why does the president of the US interrupt television programming?

The President does not actually interrupt programming. He makes speeches and the networks decide whether or not to interrupt their programming. Not every speeh is carried by every network.