answersLogoWhite

0

We use a pointer to reference a string because a string is an array of characters where every element is a char (or a wchar_t if using UNICODE strings). Passing arrays by value would require the entire array to be copied, but passing a pointer variable to an array only copies the pointer, which is effectively the same as passing the array by reference.

#include <iostream>

int main()

{

char * psz = "hello"; // pointer to a null-terminated string.

std::cout << psz; // pass the pointer (by value) to the insertion operator.

return( 0 );

}

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

How do you display nonprinting characters?

You simply have to type to an editor like the notepad to display the non-printing characters.


characters that display somewhat thicker and darker?

Can you please provide more context for characters who display somewhat thicker and darker characteristics?


Characters that display somewhat thicker?

Bold


How do you display Chinese characters in Windows?

To display Chinese characters, the Chinese Language Support is needed. Please check the step-by-step guide below.


In word characters that display somewhat thicker?

Bold


How many characters colors can Excel display?

8


Can Excel display characters in many colors?

Like all modern applications Excel has the capability to show things in various colours, so it can display characters in many colours.


What allows the user to utilize simple statements to specify the data to display print or store?

query


How do you display 4.26 million in numerals only?

It is: 4,260,000 and expressed in scientific notation it is 4.26*106


How many words can you put in a cell box?

It depends on the length of each word. The number of words does not matter; the limit is the number of total characters, including spaces. The maximum length of cell contents (text) is 32,767 characters. Only 1,024 display can display in a cell, but all 32,767 characters display in the formula bar.


What is the characters display somewhat thicker and darker than normal?

bold


What is the smallest power of 10 that your calculator can display before it switches from decimal notation to exponential notation?

That depends on the calculator model. Typically, a calculator would switch to scientific notation when the number is less than 0.001, or greater than can be shown on screen in normal notation.