Well... I try to use the "left hand side" rule used in some C standard functions... As examples:
Code:
// dest is the 'output'
char *strcpy( char *dest, char *src );
// 'buffer' is the 'output'
void *memset( void *buffer, int c, size_t size );
But I think this is a matter of preference. ONE way to document your code is to use empty lexical symbols:
Code:
#define IN
#define OUT
void util_get_string_int(IN const char *input, OUT int *output)
{
assert(input && output);
if(!str_contains_all_digits(input))
{
*output = -1;
return;
}
*output = atoi(input);
}
[]s
Fred