-1

Did I add a function in a class, to a class or into a class?
Which of the given expressions would I use to describe the changes in this code?

//class A before
class A 
{
};

//class A after
class A
{
    void aFunction();
};

closed as off-topic by Hellion, user140086, Chenmunka, Mitch, tchrist Nov 10 '16 at 2:55

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

3

As you extend the class / attach code to the class the right term to use would be:

'Added a function to a class'

In the Oxford dictionary they used this example for adding something (an additional element, ingredient, etc.):

Add the flour to the eggs, stirring continuously’

You contribute something to an existing object.

1

This contains the answer to your question.

TL;DR :

  1. (intransitive) To make an addition. To add to, to augment; to increase. It adds to our anxiety.‎

Not the answer you're looking for? Browse other questions tagged or ask your own question.