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 > Pointers, typed...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 8 Topic 26007 of 27343
Post > Topic >>

Pointers, typedef's and const's

by Alex <yakovlev@[EMAIL PROTECTED] > May 1, 2008 at 02:00 PM

The code below can't be compiled:

  typedef char* POINTER;
  const POINTER ptr;
  ptr++;

The compiler (Sun C 5.8 Patch 121015-04 2007/01/10) complains:

  "test.c", line ...: operand must be modifiable lvalue: op "++"

It looks like the "const POINTER" has been compiled to "char* const".
A question is - why?

Best wishes,
Alex
 




 8 Posts in Topic:
Pointers, typedef's and const's
Alex <yakovlev@[EMAIL   2008-05-01 14:00:46 
Re: Pointers, typedef's and const's
Robert Gamble <rgamble  2008-05-01 14:04:24 
Re: Pointers, typedef's and const's
Andrey Tarasevich <and  2008-05-01 16:42:55 
Re: Pointers, typedef's and const's
Alex <yakovlev@[EMAIL   2008-05-01 18:13:26 
Re: Pointers, typedef's and const's
Andrey Tarasevich <and  2008-05-01 18:25:33 
Re: Pointers, typedef's and const's
Jack Klein <jackklein@  2008-05-01 21:17:17 
Re: Pointers, typedef's and const's
Alex <yakovlev@[EMAIL   2008-05-02 12:30:02 
Re: Pointers, typedef's and const's
John Bode <john_bode@[  2008-05-02 13:56:07 

Post A Reply:
  Go here to Signup

AddThis Feed Button


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

Contact
tan12V112 Sat Sep 6 21:51:59 CDT 2008.