Why do we decide to put certain functions into a class?

I’m reviewing the basic with the BullCow game and I’m curious why printintro(), playgame(), string GetGuess() are non-member functions but we decide that the getters and reset() should be class functions?

Hi Ken,

In which course are you?

It was in regards to the Bull Cow Game

Is it in one of the Unity courses? I’m asking because this is the Unity subforum.

Ah, my mistake. No I meant for the unreal course.

I’ve just moved your thread to the correct subforum for you. :slight_smile:

It’s because we want to separate the I/O from the game class. This makes it easier to maintain and port it to a different framework which would handle I/O differently, like UE4 would.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms