Yes to both, although this is not good use of malloc. It allocates 10 bytes, but you should allocate N*sizeof(int) instead, where N is how many ints you want. If ints are 4 bytes on your system, this will allocate two and a half of them, of which only the first two are useful.