What you are saying in this tutorial is only partly right. There is no such thing as the data segment or the stack in C! And this is a serious mistake.
The whole point of a high-level language like C is to avoid thinking like a person who is programming in assembler.
The C standard doesn't say anything about this. Some platforms follow the model you suggest, others don't.
If you actually need to know about the data segment or the stack, then you're outside the realm of C programming.
C has such things as automatic storage, static storage, dynamic
storage, which in turn have the features ascribed to them in the C
standard.
by Rico Secada — Dec 29
What you are saying in this tutorial is only partly right. There is no such thing as the data segment or the stack in C! And this is a serious mistake.
The whole point of a high-level language like C is to avoid thinking like a person who is programming in assembler.
The C standard doesn't say anything about this. Some platforms follow the model you suggest, others don't.
If you actually need to know about the data segment or the stack, then you're outside the realm of C programming.
C has such things as automatic storage, static storage, dynamic
storage, which in turn have the features ascribed to them in the C
standard.
Apart from that - great tutorial!
Best regards, Rico.