Advertisement
MeehoweCK

Untitled

May 25th, 2023
603
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. int main() {
  4.     const char* napis = "Hope";         // const char* napis = {'H', 'o', 'p', 'e'};
  5.     const char* n = napis + 1;          // od tego momentu wskaźnik typu char n wskazuje na pierwszy element tablicy napis (znak 'o'), przesunięcie napisu o 1 w prawo
  6.     std::cout << *napis << std::endl;   // zerowy element tablicy napis ('H')
  7.     std::cout << n << std::endl;        // ope
  8.  
  9.     return 0;
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement