2
2005
Hi
In C++, are the following considered best practices or not?
- passing aguments to functions (ie functions do not take any arguments
)
- returning values using return statement
Anything else?
The reason for this question is that I had an assignment in which I was
asked to modify so that the main will call all the functions from main
itself and also do not pass any arguments except the first function.
Another issue was a LinkedList. I was not supposed to pass the Head
pointer or add a global variable. The class only had *m_pLink (the
tail pointer). Would it be ok to assign the head pointer to m_pLink
(m_pLink does take current pointer values as it progress throuhgh the
chain, but assigned the top current pointer value)? I did that and the
code works fine.
Thank you
In C++, are the following considered best practices or not?
- passing aguments to functions (ie functions do not take any arguments
)
- returning values using return statement
Anything else?
The reason for this question is that I had an assignment in which I was
asked to modify so that the main will call all the functions from main
itself and also do not pass any arguments except the first function.
Another issue was a LinkedList. I was not supposed to pass the Head
pointer or add a global variable. The class only had *m_pLink (the
tail pointer). Would it be ok to assign the head pointer to m_pLink
(m_pLink does take current pointer values as it progress throuhgh the
chain, but assigned the top current pointer value)? I did that and the
code works fine.
Thank you