# how do I init an array? don't know how to init an array

**URL:** <https://forums.developer.nvidia.com/t/how-do-i-init-an-array-dont-know-how-to-init-an-array/3870>\
**Category:** CUDA Programming and Performance\
**Created:** [May 28, 2008, 12:48pm UTC](https://forums.developer.nvidia.com/t/how-do-i-init-an-array-dont-know-how-to-init-an-array/3870 "2008-05-28T12:48:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![asali](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@asali](https://forums.developer.nvidia.com/u/asali)\
**Post date:** [May 28, 2008, 12:48pm UTC](https://forums.developer.nvidia.com/t/how-do-i-init-an-array-dont-know-how-to-init-an-array/3870/1 "2008-05-28T12:48:51Z")

</div>

I’m a beginner at cuda and have a faily basic quesition :"\>  
I want to define an array in a seperate function which is later used in another function. The function defining the array will only be used once. the other function will be called in a loop over and over again.  
Preferably I would like a third function wich free the memory of the array when I close my application.  
The cuda functions are called by my application made in c++.  
How do I do this? Help!
