This is one of those things that the standards allow implementations to "do their own thing" on. A string literal may (or may not) be in read-only memory as a constant. So, gerard4143 is absolutely correct if you want to modify the contents of the string in a platform-neutral manner. Neither gcc nor Turbo are breaking the rules. It's just that the rules are flexible in such cases. Caveat Programmer! :-)
if we try to modify the content the result is undefined when i worked with gcc in unix.
Correction: the result is always undefined, regardless of compiler. Whether it "works" or not depends on how the compiler implements string literals and enforces modification. Even if it "works", you could still be creating a subtle error down the line.
The lesson to be learned is don't rely on undefined behavior.
Need some help with this Array. I am trying to get the sum of the even numbers and the sum of the odd numbers using a for each loop. I know the answers to what I am trying to achive are sum of even = 84 and the sum of ...
I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...