c++ - Where should be parameters used for output located in the function parameters list -


i trying decide on policy regarding usage of function parameters output in our c/c++ code.

it clear me policy should indicate parameters used output should grouped either @ end or start of function parameter list, not sure there reason prefer either of these locations.

do know of reason prefer grouping them @ start or @ end?

just personal opinion, if reflects copy or assignment semantics, prefer put them beginning, string , stdio functions in c standard library do:

strcpy(dest, src); 

looks like

dest = src; 

and

fgets(buf, sizeof(buf), file); 

looks like

buf = contents_of(file); 

if, however, reason this not case, organize things input comes first, output, put output arguments end of argument list.


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -