Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ > Re: A problem a...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 7 of 7 Topic 43781 of 48417
Post > Topic >>

Re: A problem about char pointer ?

by Triple-DES <DenPlettfrie@[EMAIL PROTECTED] > Mar 10, 2008 at 10:54 PM

On 11 Mar, 02:27, "comp.lang.c++" <cnhenu...@[EMAIL PROTECTED]
> wrote:
> thanks ,I think I konw .Because "abcde" is a constant ,t just point to
> it.and so t should be a constant pointer in fact.and char t[]=3D"abcde"
> is declare a array and give it's =A0elements vuales by "abcde" , and t
> is point to the first element's address.and I want to know how to
> judge if the pointer is point to a constant in my function ? thanks!

Since your function takes a pointer to char, it should not be pointing
to a constant. Just make sure to use const char pointers when dealing
with literals. Or preferably, std::string

DP
 




 7 Posts in Topic:
A problem about char pointer ?
"comp.lang.c++"  2008-03-10 08:00:40 
Re: A problem about char pointer ?
"Victor Bazarov"  2008-03-10 11:14:34 
Re: A problem about char pointer ?
"Jim Langston"   2008-03-10 14:06:10 
Re: A problem about char pointer ?
Paul Brettschneider <p  2008-03-10 23:57:41 
Re: A problem about char pointer ?
"comp.lang.c++"  2008-03-10 18:27:25 
Re: A problem about char pointer ?
"Jim Langston"   2008-03-12 18:06:51 
Re: A problem about char pointer ?
Triple-DES <DenPlettfr  2008-03-10 22:54:51 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Nov 21 10:00:34 CST 2008.