ä½å¨é ããåããã¾ããã調ã¹ã¦ã¿ã¾ãããåã®ç解ã¯æµ ãã®ã§ééã£ã¦ããå¯è½æ§å¤§ã§ããèªåç¨ã«ã¡ã¢ãã¦ããã¾ãã malloc ã¨ã¯ï¼ C è¨èªã§ã¯mallocã¨ããé¢æ°ã使ã£ã¦ã使ãããã¡ã¢ãªãå®è¡ä¸ã«å²ãå½ã¦ããã¨ãã§ãã¾ããä¾ãã° Wikipedia ã«ããã°ãããªæã(é©å½ã« main 足ãã¦ã¾ã)ã #include <stdlib.h> int main() { /* 10åã®intã®é åã®ããã®ã¡ã¢ãªãç¢ºä¿ */ int *ptr = malloc(sizeof (int) * 10); if (ptr == NULL) exit(EXIT_FAILURE); /* ã¡ã¢ãªã確ä¿ã§ããªãã£ãã®ã§ãexit */ /* 確ä¿æå */ } malloc â Wikipedia ãããç´ æ´ã« gcc ã§ã³ã³ãã¤ã«ããã¨ãglibc(libc.so.6)ãåçã«ãªã³ã¯ããã¾ã(ããã
{{#tags}}- {{label}}
{{/tags}}