So... I understand this might be subjective, but I'd like some opinions on what the best practice for this is.
Say I have the following header and .cpp file:
header:
// foo.h
class foo
{
public:
int bar(int in);
};
cpp:
// foo.cpp
int foo::bar(int in)
{
// some algorithm here which modifies in and returns the modified value
}
Now say I have this function comment:
/*
input: an integer as input to algorithm foo
output: The result of the algorithm foo on input in
remarks: This function solves P = NP
*/
Would best practice be to place this function comment in the header above the function declaration or above the function definition in the cpp file? Thanks SO