0

How program stores pointer?

if this code gives me an error so how program store pointers as variables? https://code.sololearn.com/c39C7ETHEPGT/?ref=app

19th Apr 2022, 7:58 AM
Mustafa Emad
Mustafa Emad - avatar
5 ответов
+ 1
#include <iostream> using namespace std; int main() { int number = 1800; int *numAddress = &number; int **adrAdr = &numAddress; cout << number << endl; cout << numAddress << endl; cout << adrAdr << endl; return 0; }
19th Apr 2022, 10:30 AM
William Owens
William Owens - avatar
+ 1
If you want to store pointer addresses you can create an array of size_t size_t *my_pointers; my_pointers = malloc(size of (size_t) * numberOfPointersToStore);
19th Apr 2022, 4:35 PM
William Owens
William Owens - avatar
0
Line 11: you forgot an “e” Line 7: You are trying to assign an address of a int pointer to a varibale that holds addresses to integers. If you want the address of the pointer, youll have to use an extra *
19th Apr 2022, 8:26 AM
Raul Ramirez
Raul Ramirez - avatar
0
Raul Ramirez William Owens so I can get an address for pointer but that can leg me make endless numbers of pointers for pointers adress
19th Apr 2022, 10:57 AM
Mustafa Emad
Mustafa Emad - avatar
19th Apr 2022, 5:28 PM
Mustafa Emad
Mustafa Emad - avatar