Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstddef>
- struct pes {
- int *chave;
- };
- pes pessoa[2];
- int main() {
- const std::size_t N = 10;
- pessoa[0].chave = new int[N];
- pessoa[1].chave = new int[N];
- std::cout << sizeof(pessoa[0].chave) << std::endl;
- std::cout << sizeof(pessoa[1].chave) << std::endl;
- for (std::size_t n = 0; n < N; ++n)
- pessoa[0].chave[n] = n;
- for (std::size_t n = 0; n < N; ++n)
- pessoa[1].chave[n] = n+20;
- for (std::size_t n = 0; n < N+1; ++n)
- std::cout << pessoa[0].chave[n] << std::endl;
- for (std::size_t n = 0; n < N; ++n)
- std::cout << pessoa[1].chave[n] << std::endl;
- delete[] pessoa[0].chave;
- delete[] pessoa[1].chave;
- system("pause");
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement