<div dir="ltr">Sure. memory can be read only, but that has more to do with OS, CPU registers and segmentation, really. And it only applies to cstrings and constant numbers, really. You cant mark class/struct in ro memory, because even though class/struct is read only, fields will not be. And especially in c++ you cant because you will need to write the class in at initialization anyways. Ultimately though, pointers are just numbers, so casts work precisely.<br>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/7/7 Matthew Mondor <span dir="ltr"><<a href="mailto:mm_lists@pulsar-zone.net" target="_blank">mm_lists@pulsar-zone.net</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Sun, 7 Jul 2013 17:27:38 +0200<br>
Peter Enerccio <<a href="mailto:enerccio@gmail.com">enerccio@gmail.com</a>> wrote:<br>
<br>
> Constness of a pointer, in c and c++ means absolutely nothing. It is just a<br>
> way for programmer to self policy, same as private/public in c++/java, they<br>
> are only for compilers to throw errors and programmers to avoid those<br>
> errors. In memory, it is just data, and as data, in c you can force<br>
> compiler to represent them in any way, ie cast. Anyways, glad to be help.<br>
<br>
</div>It can also serve as a hint to the compiler such that it may optimize<br>
more aggressively by assuming that those will not be modified in that<br>
scope, so not exactly nothing :)<br>
(see <a href="http://gotw.ca/gotw/081.htm" target="_blank">http://gotw.ca/gotw/081.htm</a> for a discussion of the possibilities<br>
and limits of this though)<br>
<br>
But I agree that it's most useful for humans, and with the rest,<br>
<span class="HOEnZb"><font color="#888888">--<br>
Matt<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
------------------------------------------------------------------------------<br>
This SF.net email is sponsored by Windows:<br>
<br>
Build for Windows Store.<br>
<br>
<a href="http://p.sf.net/sfu/windows-dev2dev" target="_blank">http://p.sf.net/sfu/windows-dev2dev</a><br>
_______________________________________________<br>
Ecls-list mailing list<br>
<a href="mailto:Ecls-list@lists.sourceforge.net">Ecls-list@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/ecls-list" target="_blank">https://lists.sourceforge.net/lists/listinfo/ecls-list</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr">Bc. Peter Vaņu¹anik<br></div>
</div>