Skip to content

Latest commit

 

History

History
51 lines (35 loc) · 945 Bytes

overload_cunstructor.md

File metadata and controls

51 lines (35 loc) · 945 Bytes
description Learn how to handle with an Overloaded Constructor
title Overloaded Cunstructor Handling
ms.date 05/11/2023
ms.topic conceptual
author fejo-git
ms.reviewer ---

Overloaded Constructor

Code Example

normal constructor

TicTacToeField();

overloaded constructor

TicTacToeField(std::vector<std::vector<int>> field);

implemented overloaded constructor

TicTacToeField::TicTacTieField(std::vector<std::vector<int>> field) {
    this->field = field;
    std::cout << "I am the constructor that receives the 'field' variable as an argument." << std::endl;
}

constructor call in main function

TicTacToeField f(field);

See also