Advertisement
obernardovieira

Exemplo Struct com parametro

Jun 27th, 2013
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.49 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. struct Ply {
  4.     char nomereg[24];
  5.     int dinheiro;
  6. } Player[2];
  7.  
  8. int main() {
  9.     Player[0].dinheiro = 500;
  10.     strcpy_s(Player[0].nomereg,24,"Bernardo Vieira");
  11.     Player[1].dinheiro = 100;
  12.     strcpy_s(Player[1].nomereg,24,"Zacarias");
  13.  
  14.     std::cout << "O meu nome e "<<Player[0].nomereg<<" e tenho "<<Player[0].dinheiro<< " euros"<<std::endl;
  15.     std::cout << "O meu nome e "<<Player[1].nomereg<<" e tenho "<<Player[1].dinheiro<< " euros"<<std::endl;
  16.  
  17.     system("pause");
  18.     return 1;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement