The following code works
If I change "int *b" to "int b," as shown below, then the code does not compile. Why is this? What exactly does the statement "int *b declare?"Code:#include <iostream> using namespace std; int main() { int a = 1; int *b; b = &a; cout << " a is:" << a << endl; cout << " &a is:" << &a << endl; cout << " b is:" << b << endl; cout << " *b is:" << *b << endl; return 0; }
Code:#include <iostream> using namespace std; int main() { int a = 1; int b; b = &a; cout << " a is:" << a << endl; cout << " &a is:" << &a << endl; cout << " b is:" << b << endl; cout << " *b is:" << *b << endl; return 0; }