logoalt Hacker News

drfloyd51today at 2:55 AM2 repliesview on HN

Input.

You are passing in a memory location that can be read or written too.

That’s it.


Replies

72deluxetoday at 8:51 AM

In terms of contract in a function, you might be passing the pointer to the function so that the function can write to the provided pointer address. Input/output isn't specifying calling convention (there's fastcall for that) - it is specifying the intent of the function. Otherwise every single parameter to a function would be an input because the function takes it and uses it...

I worked on a massive codebase where we used Microsoft SAL to annotate all parameters to specify intent. The compiler could throw errors based on these annotations to indicate misuse.

This seems like an extension of that.

kevin_thibedeautoday at 2:57 AM

A pointer doesn't necessarily point to memory.

show 1 reply