Dynamic Arrays Consider you are writing a program to store student records which are bound to increase over time. There is now way to assume the size of the array before hand. In such cases static arrays are a bad choice. Instead, use dynamic arrays. Dynamic arrays can be created in C++ programs using vector class which is available in the header file vector. Since vector uses template syntax and they are not at discussed, let’s look at a program which demonstrates creating and using a vector: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
The post How to work with dynamic arrays and strings in C++ appeared first on Coding Security.
How to work with dynamic arrays and strings in C++
read more
Tidak ada komentar:
Posting Komentar