Anton pfp
Anton

@antohin

#include <stdio.h> #include <stdlib.h> int main() { // We will use the following variable as a pointer to the array: int* ptr = NULL; // There we've allocated the memory for 2 array cells: ptr = (int*)malloc(2*sizeof(int)); // Next step: fill two cells with random numbers: ptr[0] = 15; ptr[1] = -8; // Finally, print the data from the array to the screen: printf("%d %d", ptr[0], ptr[1]); return 0; }
1 reply
0 recast
1 reaction