Which call newi tem tnewp
be placed upon the programmer; there should be only one function. Pretend there is, and always use memmove.
We could replace the memmove call with the following loop:
2.7 Lists
Next to arrays, lists are the most common data structure in typical programs. Many languages have built-in list types-some, such as Lisp, are based on them-but in C we must build them ourselves. In C++ and Java, lists are implemented by a library, but we still need to know how and when to use it. In this section we're going to discuss lists in C but the lessons apply more broadly.
|
|
|
|||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|