I'm new to C++ and now I'm stuck with this problem about pointers and references that I'm not able to understand.
I've read a little bit about pointers and references but the notation is killing me.. It's just really confusing.. I need some help, with some plain simple explanation, no advanced or optimized obscure techniques here please, just plain and simple explanation of what's going on here to understand how this pointers and references work.
The case is the following:
Inside a Main class there is a ConnectionHandler object, this object is instantiated with an empty constructor and it is not yet in a usable state. In the same Main class there are also two other objects InputListenerTask and NetworkListenerTask.
Both InputListenerTask and NetworkListenerTask receive the same ConnectionHandler instance.
At some point inside InputListenerTask, the user will enter the ip, port, user, pass and this information needs to be setted to the ConnectionHandler.
All this is done inside the InputListenerTask class, and while InputListenerTask keeps running it needs to be passing this ConnectionHandler instance to several other classes that need to use this to send data over the network, also NetworkListenerTask will also start functioning and using the same connection, passing it around to it's helper classes.
I think I understand how to pass by reference from class A to class B, but it starts getting confusing when I need to store the reference as a field in B and pass it again by reference from B to C..