(adsbygoogle = window.adsbygoogle || []).push({}); My question:Code (Text):

int* a1 = malloc(4 * sizeof(int));

int* a2 = malloc(3 * sizeof(int));

int* a3 = malloc(5 * sizeof(int));

a1[0] = 1; a1[1] = 2; a1[2] = 3; a1[3] = 4;

a2[0] = 9; a2[1] = 8; a2[3] = 7;

a3[0] = -1; a3[1] = -2; a3[2] = -3; a3[3] = -4; a3[4] = -5;

Are a1, a2 and a3 arrays? I think they are pointers that point to an array right?

Secondly, If a1, a2, and a3 are considered to be arrays, are they of the same size?

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Arrays and pointers in C

**Physics Forums | Science Articles, Homework Help, Discussion**