MCPcopy Create free account
hub / github.com/CodeWithHarry/The-Ultimate-C-Programming-Course / main

Function main

Chapter 11/05_realloc.c:4–14  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2#include <stdlib.h>
3
4int main(){
5 int n = 5;
6 int* ptr;
7 ptr = (int*) malloc(n * sizeof(int));
8 ptr[0] = 3;
9 printf("%d", ptr[0]);
10
11 ptr = (int*) realloc(ptr, 10 * sizeof(int));
12 printf("%d", ptr[0]);
13 return 0;
14}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected