![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 |
|
Professional Programmer
Join Date: May 2005
Location: Bad Nauheim, Germany
Posts: 436
Rep Power: 4
![]() |
I thought string literals like "yadda yadda" were always constant (of type const char[])? The nature of a string literal. Or is that just in C++?
EDIT: Ok, I found it. in (ISO) C, as you said, string literals are of type char [], but are unmodifiable. Attempting to modify a string literal results in undefined behavior. In (ISO) C++, the type is const char [] from the get go. I find this more sympathetic ![]()
__________________
-Steven "Is this a piece of your brain?" - Basil Fawlty Last edited by stevengs; Oct 5th, 2005 at 3:22 PM. |
|
|
|
|
|
#12 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
No compiler can force write protection without intimate arrangements and cooperation with system software. That is strictly implementation specific, despite what standards may or may not state. Nor can it successfully declare your memory writable if I stuff ROM in the appropriate slots.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|