by jacquesm · 5y ago · 0 comments
int increment(a)
{
return a+1;
}
void somefunc()
{
int b = 5;
b = increment(b);
printf("b now %d\n", b);
} T get_t(int how, char **error);
int get_val(T *v);
One could rewrite these as struct get_t_res {T; char *};
struct get_t_res get_t(int);
struct get_val_res {int; T};
struct get_val_res get_val();
But what do you think of it?For the use cases that are too expensive to use functions, macros can be used instead.
However that is only if C++ cannot be used at all, otherwise don't bother.