Skip to content

Commit

Permalink
Fixed: sizeof arrays typos (selfboot#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
bryceliu authored and selfboot committed Mar 15, 2017
1 parent 4a437af commit 54b20d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Coding/sizeof_demo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ int main ( ) {

cout << "--- Array ---\n";
float f[] = {1.0,2.0,3.0,4.0,5.0};
cout << "Array " << sizeof(f) << "\n"; // 5
cout << "Array " << sizeof(f) << "\n"; // 20
char str[]="Tencent";
cout << "Array " << sizeof(str) << "\n"; // 20
cout << "Array " << sizeof(str) << "\n"; // 8

cout << "--- Vector, String ---\n";
vector<int> v(10, 0);
Expand Down

0 comments on commit 54b20d5

Please sign in to comment.