While reading a book, I came across these lines :
There is very little syntactical difference between structures and classes in C++ and, therefore, they can be used interchangeably with minor modifications. The only difference between structure and a class is that, by default, the members of a class are private,while, by default, the members of structure are public.
However, my teacher told me that we cannot have functions inside structures. The book I've read is quite popular and I think that what written on it is correct. Is it possible to have functions inside structures ? If yes, kindly leave an example or reference link.