char * const &szKey

K

Kip

Greetings,

Could anyone explain to me how the parameter type works here? I am also
interested in the technical details of what is actually happening on
the stack. I have never seen a "char * const &szFoo". I usually just
use "char *pszFoo" whenever I want to pass a string, or maybe "const
char *pszFoo" if I know that I won't modify it. Thanks.

// Hash a string...
unsigned int StringHash(char * const &szFoo)
{
.
.
.
}
 
G

Gianni Mariani

Kip said:
Greetings,

Could anyone explain to me how the parameter type works here? I am also
interested in the technical details of what is actually happening on
the stack. I have never seen a "char * const &szFoo". I usually just
use "char *pszFoo" whenever I want to pass a string, or maybe "const
char *pszFoo" if I know that I won't modify it. Thanks.

// Hash a string...
unsigned int StringHash(char * const &szFoo)

szFoo is a reference to a const pointer to char.

i.e.

char str[100];

char * const str_ptr = str;

StringHash( str_ptr )
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,228
Latest member
MikeMichal

Latest Threads

Top