False statement about The C Programming Language
maxmosk opened this issue · comments
- I have searched open and closed issues and pull requests for duplicates, using these search terms:
- C
- C++
- Method
- I have checked the latest
main
branch to see if this has already been fixed, in this file:
URL to the section(s) of the book with this problem:
Line 815 in 3dca2fc
Description of the problem:
There are no any methods in C, ->
and .
both can be used only for fields access.
Suggested fix:
Write True about this language. I can fix it.
While it is technically true that C does not have methods, you can absolutely store a function pointer on a struct in C and then call it using ->
access. (There is a reason for C++’s use of that exact syntax. 😉) Closing this as the point here is not pedantic precision about C and C++ but rather getting the point across about how Rust differs from them. Thanks, though!