3 ms·
> - Why A.B()? Period gets read as a sentence terminator and that function is being called with no parameters, which makes no sense. What C syntax is this refe
by futharkshill 5y ago
> - Why A.B()? Period gets read as a sentence terminator and that function is being called with no parameters, which makes no sense.
What C syntax is this referring to?
- arcticbull 5y agoYou can do that, with a structure and a function pointer. struct a { void (*B)(); } struct a A = { .B = ... }; A.B();
- futharkshill 5y agoGreat example, especially considering op found that he added that example as a mistake :D
- pyjarrett 5y agoI severely overloaded a reference to C-family syntax and should have provided multiple examples instead. I erred, by trying to avoid C, C++, Java etc. specific comparisons. What I should have written: - Why is "Foo()" a function is being called with no parameters, which makes no sense. - What is "A.B" Period gets read as a sentence terminator. I learned C++ and Java very early on in life and had never considered A.B to be an issue.
- futharkshill 5y agoI think the only "hard" part about the syntax of C are pointers. Reading e.g. i++ *a->b[0]