Skip to content

Commit

Permalink
Update ex2_35.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Mooophy committed Jun 19, 2015
1 parent 3dd19a6 commit 0d03d76
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions ch02/ex2_35.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@

int main()
{
const int i = 42;
auto j = i;
const auto &k = i;
auto *p = &i;
const auto j2 = i, &k2 = i;
const int i = 42;
auto j = i;
const auto &k = i;
auto *p = &i;
const auto j2 = i, &k2 = i;

// print i means int, and PKi means pointer to const int.
std::cout << "j is " << typeid(j).name()
<< "\nk is " << typeid(k).name()
<< "\np is " << typeid(p).name()
<< "\nj2 is " << typeid(j2).name()
<< "\nk2 is " << typeid(k2).name()
<< std::endl;
// print i means int, and PKi means pointer to const int.
std::cout << "j is " << typeid(j).name()
<< "\nk is " << typeid(k).name()
<< "\np is " << typeid(p).name()
<< "\nj2 is " << typeid(j2).name()
<< "\nk2 is " << typeid(k2).name()
<< std::endl;

return 0;
return 0;
}

0 comments on commit 0d03d76

Please sign in to comment.