Commit c7c188d7407d1fe27dcae223b5b5977ae27e457f
1 parent
29b1510128
Exists in
master
add memory leak
Showing 2 changed files with 32 additions and 0 deletions Side-by-side Diff
lab2/memory_access.c
View file @
c7c188d
1 | + | |
2 | +#include <stdlib.h> | |
3 | +#include <stdio.h> | |
4 | +#define DIM 100 | |
5 | +int main(int argc, char *argv[]) | |
6 | +{ | |
7 | + //float *a; | |
8 | + int i; | |
9 | + float a[DIM]; | |
10 | +// a = (float *) malloc( sizeof(float) * DIM ); | |
11 | + for( i = 0; i < DIM; ++i) a[i] = 0.0; | |
12 | + // sup = k; | |
13 | + // k = a[i]; | |
14 | + a[200] = 99.0; | |
15 | + printf("GOOD END \n"); | |
16 | +// free(a); | |
17 | + return(EXIT_SUCCESS); | |
18 | +} |
lab2/memory_leak.c
View file @
c7c188d