※スタイルシート未対応ブラウザではレイアウトを正確に再現できません。
  < The returning  contents  advance >   
                   < [modosusu] > Color magazine monochrome light and shade   font predetermined, Gothic Ming-style type longhand   size Konaka large   standard  


  I want to use dynamic array &malloc.   

  1. ..clause 1..: The method is not understood though I want to declare a dynamic array by using malloc.

[1] The method is not understood though I want to declare a dynamic array by using malloc.

First of all, malloc is not necessary in the program that the beginner makes.
The personal computer nowadays is char s[1000000];Do not make it to [biku] in the array of the level.
Moreover, it is necessary to refrain from malloc oppositely for building in for the memory saving.
Read the following usage after basing that.

[   How to use of easiest malloc   ]
Secure the memory as follows. It is the same also excluding the int type. Even the structure.
  int *data;
  Data = Malloc (Sizeof(int) necessary number of elements of *);

The secured memory can be used by doing just like a usual array.
  data[i] = 10;

Increase it as follows when coming to want to increase the number of elements.
  Data = Realloc (Data and sizeof(int) necessary number of elements of *);

Thus, liberate it when you do not use the array.
  free(p);
If it is a very small-scale program, it should not be liberating according to the free function.
However, because the possibility that the teacher and the superior are angry that free is not put up is high
Call the free function at the end of the main function.

It returns to contents.


< - Advanced -> to the returning following. the first  that returns