Added a tutorial on memory use in C
You can read the tutorial here. It looks at the different ways memory is used in a C program. Do you know for instance what BSS is and when it is used compared to Data or where variables in a function declared static are held in memory?
I also tried overwriting a text literal out of curiosity to see what happens. Here’s the source:
#include<stdio.h>
#include <string.h>
char* name="My name is David";
int main()
{
strcpy_s(name,10, "New name");
printf("Name = %s\n", name);
return 0;
}
As you’d expect it blew up”