Top "Dynamic-arrays" questions

Anything related to dynamic arrays, i.e. array-like data structures where the length of the array (the number of its elements) can be changed at runtime, thus allowing adding or removing elements without explicit memory allocation and management.

How to free a pointer to a dynamic array in C?

I create a dynamic array in C with malloc, ie.: myCharArray = (char *) malloc(16); Now if I make a function like …

c pointers free dynamic-arrays
Arraylist in C not working

I am currently writing a program to implement an arraylist (or dynamic array) in C. Hmm... I think I have 70 …

c arrays data-structures arraylist dynamic-arrays
Dynamic arrays inside a class

I am doing the following exercise at the moment: A generic Matrix class (15 pt) a) Create a class called Matrix, …

c++ class matrix dynamic-arrays
Copying from One Dynamically Allocated Array to Another C++

This seems like it should have a super easy solution, but I just can't figure it out. I am simply …

c++ memory dynamic-arrays
How to initialize a dynamic array in java?

If I have a class that needs to return an array of strings of variable dimension (and that dimension could …

java dynamic-arrays
How to use std::getline() to read a text file into an array of strings in C++?

I am trying to use std::getline() in my project to read in a text file into an array of …

c++ arrays file-io fstream dynamic-arrays
How to increase array size on-the-fly in Fortran?

My program is running though 3D array, labelling 'clusters' that it finds and then doing some checks to see if …

arrays fortran fortran90 dynamic-arrays
How to initialize a dynamic int array elements to 0 in C

I created a dynamic array ,and i need to initialize all the members to 0. How can this be done in …

c arrays dynamic-arrays
Dynamically allocated 2 dimensional array

I am trying to build two dimensional array by dynamically allocating. My question is that is it possible that its …

c multidimensional-array dynamic-arrays dynamic-allocation
Range-based for loop on a dynamic array?

There is a range-based for loop with the syntax: for(auto& i : array) It works with constant arrays but …

c++ arrays c++11 foreach dynamic-arrays