repl.it
@molinitomario/

Trying out classes

C++

trying to test my knowledge on classes

fork
loading
Files
  • main.cpp
  • Player.cpp
  • Player.h
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
#include <iostream>
#include "Player.h"

int main() {
  std::cout << "Hello World!\n";
  Player player("Mario");
  // above is a constructor with some default values, we can have multipel constructors as well
  std::cout << player.GetPlayerName();

  player.AddWeapon("Minigun");
  
}
Fetching token
?