S
sidaf
Hello,
I've a background in Java programming but I've just started to code a
bit in C++. I've come across some things in other developers code which
have confused me a bit. I'm hoping somebody here can clarify the
following code for me.
Snippet 1:
class Foo : public Bar {
...
Foo::Somefunction()
...
if (bytesread <= 0) {
// Close the connection
::close(fd);
i = clients.erase(i);
continue;
}
...
}
...
}
I thought that the ::close(fd) function called another function defined
in Foo, but there's no function with that name defined, then I thought
it must be in Bar, but still no sign. What does the :: point to?
Sometimes I see functions written as followed:
SomeObject::SomeFunction() {
....
}
and then some written like this:
OtherObject::OtherFunction() {
....
};
What does the ; at the end mean?
Thanks,
Sidaf
I've a background in Java programming but I've just started to code a
bit in C++. I've come across some things in other developers code which
have confused me a bit. I'm hoping somebody here can clarify the
following code for me.
Snippet 1:
class Foo : public Bar {
...
Foo::Somefunction()
...
if (bytesread <= 0) {
// Close the connection
::close(fd);
i = clients.erase(i);
continue;
}
...
}
...
}
I thought that the ::close(fd) function called another function defined
in Foo, but there's no function with that name defined, then I thought
it must be in Bar, but still no sign. What does the :: point to?
Sometimes I see functions written as followed:
SomeObject::SomeFunction() {
....
}
and then some written like this:
OtherObject::OtherFunction() {
....
};
What does the ; at the end mean?
Thanks,
Sidaf