fork download
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4.  
  5.  
  6. int main(){
  7. int x = 42;
  8. int* ptr = &x;
  9.  
  10. // 使用 printf 打印指针地址
  11. printf("Address of x: %p\n", (void*)ptr);
  12. //const unsigned SIZE_OF =5;
  13. //int const numbers[SIZE_OF] = {0, 1, 0, 1, 0};
  14. //int const * const numberIterator = std::find(numbers, numbers+SIZE_OF, 1);
  15. //std::cout << std::distance(numbers, numberIterator);
  16.  
  17. //std::vector<int> myvector;
  18. //for(int i = 1; i<=10; i++)
  19. //myvector.push_back(i);
  20. //myvector.erase(myvector.begin() +6);
  21. //myvector.erase(myvector.begin(), myvector.begin() +4);
  22. //for(unsigned i = 0; i< myvector.size();++i)
  23. //std::cout <<''<<myvector[i];
  24.  
  25. }
  26.  
Success #stdin #stdout 0.01s 5280KB
stdin
Standard input is empty
stdout
Address of x: 0x7ffcf4924d74