Il seguente codice contiene tre errori di sintassi: individuarli e correggerli.
Last active
March 25, 2025 05:49
-
-
Save marcosecchi/8bff6ed859cb46e2a87cd13283948e16 to your computer and use it in GitHub Desktop.
01 - Basi di C++ - Errori di Sintassi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
using namespace std; | |
class BaseCharacter | |
{ | |
string name; | |
public: | |
void Attack() | |
{ | |
cout << name << " is attacking << endl; | |
} | |
void Parry() | |
{ | |
cout << name << " is parrying" << endl; | |
} | |
void SetCharacterName(string value) | |
{ | |
name = value | |
cout << "Character is named: " << name << endl; | |
} | |
}; | |
int main() | |
{ | |
BaseCharacter Leonatos; | |
Leonatos.setCharacterName("Leonatos"); | |
Leonatos.Attack(); | |
Leonatos.Parry(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment