Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //main.cpp
- #include <iostream>
- #include "next.hpp"
- extern carro Carrao;
- int main() {
- saida();
- std::cout << Carrao.rodas << std::endl;
- Carrao.rodas = 10;
- std::cout << Carrao.rodas << std::endl;
- saida();
- std::cout << Carrao.rodas << std::endl;
- system("pause");
- return 1;
- }
- //next.cpp
- #include <iostream>
- #include "next.hpp"
- carro Carrao;
- void saida() {
- Carrao.rodas = 5;
- }
- //next.hpp
- #ifndef NEXT_HPP
- #define NEXT_HPP
- struct carro {
- int rodas;
- int portas;
- };
- void saida();
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement