Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

memory layout in c

#include <stdio.h>

char c[]="rishabh tripathi";     /*  global variable stored in Initialized Data Segment in read-write area*/
const char s[]="HackerEarth";    /* global variable stored in Initialized Data Segment in read-only area*/

int main()
{
    static int i=11;          /* static variable stored in Initialized Data Segment*/
    return 0;
}
Source by www.hackerearth.com #
 
PREVIOUS NEXT
Tagged: #memory #layout
ADD COMMENT
Topic
Name
3+8 =