Contents
Are pointers difficult?
The concept of pointers is not that hard,;avoiding making errors with them, especially as a new user, is what is hard. It’s even more problematic because pointers can result in some really nasty errors, and new C programmers just wouldn’t have the skillset or experienced required to debug pointer errors.
Why recursion is so difficult?
What makes recursion confusing? The key reason is that we are looking at the same function with different values of local variables. It is very important to make sure which input is currently being used when you are analyzing a recursive function.
What’s the problem with pointers and recursion in C?
The problem with pointers and recursion is not that they’re necessarily hard to understand, but that they are taught badly, especially with respect to languages like C or C++ (mainly because the languages themselves are being taught badly). Every time I hear (or read) someone say “an array is just a pointer” I die a little inside.
Why is recursion difficult for most people to do?
The problem is that giving code proper structure requires certain mental leaps of abstraction, which don’t come natural to most people. Anything that can be done with small, incremental steps only tends to be more popular. Recursion isn’t difficult. Making a mental shift into a different mode of thinking is difficult.
What are some of the problems with pointers?
There are several difficulties with pointers: Aliasing The possibility of changing the value of an object using different names/variables. Non-locality The possibility of changing an objects value in a context different from the one in which it is declared (this also happens with arguments passed by reference).
Why are there so many problems with recursive functions?
The difficulty with recursive functions happens when people without enough mathematical background (where recursiveness is common and required knowledge) try to approach them thinking that the function will behave differently depending on how many times it has been called before.