source:
CIVL/mods/dev.civl.com/examples/library/stdlib/malloc2.c@
cb4d4f4
| Last change on this file since cb4d4f4 was aad342c, checked in by , 3 years ago | |
|---|---|
|
|
| File size: 222 bytes | |
| Rev | Line | |
|---|---|---|
| [21e2858] | 1 | #include<stdio.h> |
| 2 | #include<stdlib.h> | |
| 3 | ||
| 4 | int sum=0; | |
| 5 | char* c; | |
| 6 | ||
| 7 | int main(){ | |
| 8 | if(!c) | |
| 9 | sum=1; | |
| 10 | printf("%d\n", sum); | |
| 11 | c=malloc(sizeof(char)); | |
| 12 | if(!(c[0]=='a')) | |
| 13 | sum=2; | |
| 14 | printf("%d\n", sum); | |
| 15 | free(c); | |
| 16 | } |
Note:
See TracBrowser
for help on using the repository browser.
