Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

cpp please help me

+1 vote
asked Sep 6 by olobolo2137 (180 points)
my cpp code is not working properly please help me

#include <iostream>

class Klasa
{
    int MojInt;
public:
    void Set( int n );
    int Get();
};

void Klasa::Set( int n )
{
    MojInt = n;
}

int Klasa::Get()
{
    zwróć MojInt;
}

using namespace std;

int main()
{
    Klasa k;
    k.Set( 16 );
    std::cout << k.Get();
}

1 Answer

0 votes
answered Sep 8 by Peter Minarik (78,090 points)

If you use the reserved English keyword return instead of the Polish zwróć, then your code runs.

You can name your variable whatever, but reserved key words cannot be replaced (well, you can use macros if you're really desperate XD).

I'd recommend writing your entire code in English so it's easier to share it with the community, others will have an idea what your variables and functions mean without the need to rely on (not perfect) translation tools.

Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...