Creating an Array: Difference between revisions

→‎[[C]]: wrong, standard library is needed for malloc and memset
mNo edit summary
(→‎[[C]]: wrong, standard library is needed for malloc and memset)
Line 46:
'''Compiler:''' GCC, MSVC, BCC, Watcom
 
'''Libraries:''' [[None are needed]]Standard
//* Dynamic */
#include <stdlib.h> /* for malloc */
#include <string.h> /* for memset */
int n = 10 * sizeof(int);
int *myArray = (int*)malloc(n);
Line 59 ⟶ 61:
}
 
'''Libraries:''' [[None are needed]]
//* Static */
int myArray2[10] = { 1, 2, 0}; /* 3..9 := 0 */