0

Ever have a brain fart while writing up documentation and not recalling what the programmer-friendly name of something is? Well, it is happening to me.

What so we call the "SSL *s" and the "-> recordsizelimit" here in this capture? I though we called "s ->" a member or parent or something and the "recordsizelimit" is a extension or child or something. I created it, I wrote the code, I created the recordsizelimit, I called it elsewhere... but I can't remember the official name of "s" and the value after the ->

Code Snippit

Any thoughts?

Stryker2k2
  • 108
  • 9
  • 2
    Arrow operator? https://stackoverflow.com/questions/2575048/arrow-operator-usage-in-c – Sasha Dec 31 '21 at 15:17
  • That kind of gets me in the right area. "It's just the dot version when you want to access elements of a struct/class that is a pointer instead of a reference." So, I guess "struct -> element"? – Stryker2k2 Dec 31 '21 at 15:24
  • 1
    More like `instance->member`. https://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B#Member_and_pointer_operators – Sasha Dec 31 '21 at 15:28
  • 1
    Possibly helpful: https://stackoverflow.com/questions/1580757/what-is-the-official-name-of-cs-arrow-operator – Chris Dec 31 '21 at 15:58
  • I think all of these comments are dead on. But the way @EricPostpischil said it makes perfect sense and give extra clarification. Eric, if you were to copy and paste that as an "Answer", I will flag it as the official answer. Thanks a ton, Eric and team! – Stryker2k2 Dec 31 '21 at 16:01
  • Look at the mouseover text on the downvote arrow: "This question does not show any research effort; it is unclear or not useful." Does this deserve to be upvoted? – Chris Dec 31 '21 at 16:28

1 Answers1

1

In s->recordsizelimit, s is a pointer to a structure (or union). -> does not have a name; the C standard calls it “the -> operator”, except it is parenthetically described in the index as a “minus-greater punctuator” and a “structure/union pointer operator”, but these are used nowhere else in the standard. recordsizelimit is a member name. s->recordsizelimit is a member of a structure.

Eric Postpischil
  • 195,579
  • 13
  • 168
  • 312
  • For ISO/C: In n1570, it is called the "arrow operator" in the index [and `.` is called the "dot operator"]. In the index in n1124, it is called "structure/union pointer operator" For ISO/C++: in n4296, 5.2.4/5.2.5 it is called an "arrow". But, there are many docs that call it the "arrow operator". And, it's called that in other langs like perl. So, IMO, by estoppel, it's the "arrow operator" (and "dot operator"). It's easier to pronounce that the n1124 naming. And, in speech, `x->y` would be "x arrow y" [or "x points to y"] – Craig Estey Dec 31 '21 at 18:12