Normally when we write:
int a = 10;
int* ptr = &a;
std::cout << *ptr;
Code output is:
> 10
But when I write this:
const wchar_t* str = L"This is a simple text!";
std::wcout << str << std::endl;
std::wcout << &str << std::endl;
Code output is:
> This is a simple text!
> 012FFC0C
So this makes me confused.
- Doesn't that Asterisk symbol stand for pointer?
- If it is a pointer, how is it possible for us to assign a value other than the address value?
- Shouldn't the top output be at the bottom and the bottom output at the top?