Re: const modifier

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



const char * some_ptr; 
// is same as 
char * const some_ptr;
// You can think in this way:
/* In the later one, const is used for some_ptr that
is a pointer to char. So here the pointer is constant.
In the former case also you have made ( char *) as
constant :). So they are the same
*/

 --- tune more <tunemore@yahoo.com> wrote: > Hi,
> 
> Here is an example of "const modifier" usage:
>      int execv(const char *path, char *const
> argv[]);
> Is there any different between const before char *
> and
> const after char *.
> 
> __________________________________________________
> Do you Yahoo!?
> Y! Web Hosting - Let the expert host your web site
> http://webhosting.yahoo.com/
> --
> Kernelnewbies: Help each other learn about the Linux
> kernel.
> Archive:      
> http://mail.nl.linux.org/kernelnewbies/
> FAQ:           http://kernelnewbies.org/faq/
>  

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux