I have an array of double pointers, but every time I try do print one of the values the address gets printed. How do I print the actual value?
cout << arr[i] ? cout << &arr[i] ? they both print the address
Does anyone know?
I have an array of double pointers, but every time I try do print one of the values the address gets printed. How do I print the actual value?
cout << arr[i] ? cout << &arr[i] ? they both print the address
Does anyone know?
If it's really an array of (initialized) double pointers, i.e.:
double *arr[] = ...
// Initialize individual values
all you need is:
cout << *arr[i];
cout << *(arr[i]);
5 + 112 % 65 ^ 1 / 5.5 && bar || foo^2 << 5
either, but (((5 + (112 % 65)) ^ (1 / 5.5)) && bar) || (foo^(2 << 5))
is much more clear –
Bright If "arr" is declared as
double* arr[..];
Then you would use:
cout << *(arr[i])
© 2022 - 2024 — McMap. All rights reserved.