In your examples it doesn't make a whole lot of difference, since arguments are passed by value. Even if the function does modify its arguments, they don't affect the rest of the program.zaval wrote:In any case, this is for nothing useful. Honestly, I think at least for C using const for arguments is a plain dumb nonsense.
But it's a much bigger difference once you consider pointers. For example, look at these two function signatures:
Code: Select all
int function1(int * a);
int function2(const int * a);
Edit: fixed dumb mistake