Advertisement
bhok

size_t tip-bit

Oct 1st, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstring>
  3.  
  4. int main()
  5. {
  6.  
  7.     // size_t
  8.     // It is a data type that is guarenteed to hold an array index
  9.     // Mostly used for counting something that cannot be negative
  10.     // Can be used with strlen() "string length"
  11.  
  12.     char name[5] = { 'n','a','m','e' };
  13.     size_t size = strlen(name);
  14.  
  15.     std::cout << size;
  16.     system("pause");
  17.  
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement