Last active
August 29, 2015 13:56
-
-
Save AlexsJones/9054489 to your computer and use it in GitHub Desktop.
Memory mapping layout explained
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* ===================================================================================== | |
* | |
* Filename: main.c | |
* | |
* Description: | |
* | |
* Version: 1.0 | |
* Created: 02/17/14 07:56:15 | |
* Revision: none | |
* Compiler: gcc | |
* | |
* Author: jonesax (), | |
* Organization: | |
* | |
* ===================================================================================== | |
*/ | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
const char *pp = "DATA SEGMENT"; | |
void out() //TEXT SEGMENT | |
{ | |
printf("%s\n",pp); | |
char p[6] = { 'S','T','A','C','K'}; | |
printf("%s\n",p); | |
char *ppp = malloc(sizeof(char) * 5); | |
memcpy(ppp,"HEAP",4); | |
printf("%s\n",ppp); | |
} | |
int main(int argc, char **argv) | |
{ | |
out(); //TEXT SEGMENT | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment