Dynamic vs dynamically created arrays in C -
i'm in programming class , excerpt textbook:
"there 2 basic ways create array, statically , dynamically. note dynamically created array not same thing dynamic array; dynamically created array can fixed-size in c. "
my professor saying things pretty directly contradict quote, , being evasive when ask further questions. doesn't seem acknowledge there difference between dynamic vs fixed-size , dynamically-created vs. statically-created. don't know enough c argue him , since he's 1 wrote textbook, i'm little lost @ moment.
- what difference between statically-created vs. dynamically-created , dynamic vs. static arrays?
- do "dynamic" (not dynamically-created) arrays exist in c?
the textbook "the art , craft of programming: c edition" john lusth. wrong professor being 1 wrote it, author different cs professor @ school.
when professor uses word dynamic means array can change size on fly. new elements can added or deleted array. dynamically allocated array means allocation of array @ run-time in heap. statically allocated arrays allocated before main function gets control.
take account c has variable length arrays (vla). bit not same dynamic arrays. vla means array may recreated different sizes. in each such recreation create new array.
an example of dynamic array standard c++ class std::vector.
Comments
Post a Comment