Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dynamic data in c++

Tags:

c++

I'm coding in C++ and I'm in need for a dynamic data storage, like ArrayList in C# or Java.

Can anyone help me with that? I'm not sure what to use. Thanks!

like image 237
Ricardo Avatar asked Jul 22 '10 17:07

Ricardo


People also ask

What is dynamic function in C?

Dynamic Memory in C. In C, dynamic memory is allocated from the heap using some standard library functions. The two key dynamic memory functions are malloc() and free(). The malloc() function takes a single parameter, which is the size of the requested memory area in bytes. It returns a pointer to the allocated memory.

What is dynamic data in programming?

What is Dynamic Data Structure? In Dynamic data structure the size of the structure in not fixed and can be modified during the operations performed on it. Dynamic data structures are designed to facilitate change of data structures in the run time. Example of Dynamic Data Structures: Linked List.

What is a dynamic array in C?

Dynamic arrays are resizable and provide random access for their elements. They can be initialized with variable size, and their size can be modified later in the program. Dynamic arrays are allocated on the heap whereas VLAs are allocated on the stack.

What is static and dynamic data?

As you may have guessed, static data refers to a fixed data set—or, data that remains the same after it's collected. Dynamic data, on the other hand, continually changes after it's recorded in order to maintain its integrity. In concept, the difference between static and dynamic data is simple enough to understand.


1 Answers

std::vector is what you're looking for.

like image 187
Hamid Nazari Avatar answered Nov 11 '22 06:11

Hamid Nazari