As I understand it, the reference operator (&) represents the memory location of the value of a variable. I'm also sure I read somewhere that you can't pass a class as a function argument.

So in main, I make an example TestClass, and pass it to the two method of that. One of them takes, as the argument, just the value as a type of that class, and the other puts the reference operator in it. Both then output the reference part.

In 'b', what am I actually defining as the argument? O_o And what's the difference between the two? The 'this' value matches 'b' but not 'a'. Why?

>>I'm also sure I read somewhere that you can't pass a class as a function argument.

You must have misread it. The class in a is a new instance of the class while the class in b is the same instance. In a the class is passes by value, meaning that the compiler duplicated it and gives it another this pointer.

>>I'm also sure I read somewhere that you can't pass a class as a function argument.

You must have misread it. The class in a is a new instance of the class while the class in b is the same instance. In a the class is passes by value, meaning that the compiler duplicated it and gives it another this pointer.

Oooh. So if you need to pass a specific instance of a class, you use the & operator in the argument definition? Cheers! Does that mean that passing 'example' as the argument to 'a' doesn't really do anything, if the compiler just duplicates the class, and passing any instance of that class would have exactly the same effect?

I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...

Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...