Answer the question
In order to leave comments, you need to log in
How to work with a pointer to a dynamic array in "C"?
Let's say this piece of code:
float *arr;
arr = malloc( 16 * sizeof(float) );
arr[0] = 1.0;
arr[1] = 1.5;
arr[2] = 2.0;
arr[3] = 1.0;
arr[4] = 1.5;
arr[5] = 2.0;
Answer the question
In order to leave comments, you need to log in
void workwitharray(float *array){
array[3] = 1.0;
array[4] = 1.5;
array[5] = 2.0;
}
workwitharray(arr);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question