Re: const char* to char*
Re: const char* to char*
- Subject: Re: const char* to char*
- From: Nat! <email@hidden>
- Date: Fri, 28 Nov 2003 00:09:31 +0100
Am 27.11.2003 um 23:12 schrieb Jens Bauer:
Easy..
const char *cName = [theName cString];
:)
const means you shouldn't write into it.
You can't strcpy into it, but you can strcpy from it.
On Thursday, November 27, 2003, at 10:59 PM, David Cairns wrote:
i am getting this silly warning when compiling in Xcode. The warning
comes from the line
char *cName = [theName cString];
how can i work around this such that i avoid this error? would
strcpy work?
const char and char are different types.
You can also avoid the warning like this:
char *s;
s = (char *) [theName cString];
it costs nothing and keeps the compiler quiet. I try to avoid going
down the "const" road :)
Ciao
Nat!
I act professionally, when I get paid for it. - Unknown
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.