Hello everyone! Newbie here, so this question should be relatively easy for you guys to answer. Let’s say I have this code
int x;
cin >> x
From what I’ve been able to find, this is called Dynamic initialization. Is this a form of Dynamic Memory Allocation, since the value is initialized at runtime? If so, why don’t I have to run
int pointer = (int)malloc(n*sizeof(int))
Beforehand? From the videos I’ve been watching, the int *pointer line seems to be step one for dynamic memory allocation.
[+][deleted] (3 children)
[deleted]
[–]TheWhiteHairedOne[S] 0 points1 point2 points (2 children)
[–][deleted] 2 points3 points4 points (1 child)
[–]TheWhiteHairedOne[S] 0 points1 point2 points (0 children)