First of all, I'd like to say hi to everyone as I am new to this place- so Hi!
As a newbie to C++ I have some lame questions, that I couldn't find answers to ;-)
The first one: what is a reference to type? I know references to variables (a bit different from pointers), but how would we refer to type?
The second question will include an example from the book I am learning from:
1 2 3 4 5 6 7 8 9 10
|
class SomeClass
{
int value=1;
friend void f1(SomeClass & p);
}
void f1 (SomeClass & p)
{
cout<<p.value;
}
|
To my knowledge references can work as pointers, so does this piece of code mean, that function
f1
takes an argument being an object of type/class
SomeClass
and refers to it (manipulates the original instance of this object) using reference
p
just like a pointer?
Number three. Any good books on generic programming? I know I am still a bit far from it but I like to know things in advance :-)
Thank you for your time to read this post!