Can C++ struct have member functions?

前端 未结 6 1865
孤街浪徒
孤街浪徒 2021-01-30 13:10

I was pretty confused about the difference between struct and class as I seemed to see them used for pretty much the same things. I googled the differences and the only answer I

6条回答
  •  我在风中等你
    2021-01-30 13:54

    Your lecturers are demonstrably wrong, assuming they are actually talking about C++ and not C.

    It's trivially easy to prove this to yourself in code, or pick up The C++ Programming Language and look up structs.

提交回复
热议问题