electroRF
Member
Hi,
I have a question please.
When one performs
or
a const (i.e. read-only) memory is created in the data segment - (i.e. not the heap/stack? is it created already in compilation?) - 5 bytes for "abcd" and 7 bytes for "123456" ?
so one cannot write new characters into s1 or s2, right? as they point on "read-only" memory?
what about:
also here a 'read-only' memory is created in the data segment?
Thank you very much.
I have a question please.
When one performs
PHP:
char *s1 = "abcd";
PHP:
char *s2;
s2 = "123456";
a const (i.e. read-only) memory is created in the data segment - (i.e. not the heap/stack? is it created already in compilation?) - 5 bytes for "abcd" and 7 bytes for "123456" ?
so one cannot write new characters into s1 or s2, right? as they point on "read-only" memory?
what about:
PHP:
strcpy(s3, "hello");
also here a 'read-only' memory is created in the data segment?
Thank you very much.