LabWindows/CVI Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
shel

Allow Large Arrays

Status: New

A byte array is limited to 2GB because the index is an int. Allow the use of long for an index so large arrays can be used.

1 Comment
LuisG
NI Employee (retired)

Why does the index have to be an int? (By the way, in CVI a long and an int are identical). There's nothing to stop you from indexing an array with a 64-bit integer, or preferably with a size_t variable.

 

In a 32-bit program, you'll have a hard time allocating a contiguous array that's greater than 2 GB. But if you have a 64-bit OS, you can easily create a 64-bit program that does just that. And if you use a size_t variable for your index, this variable will be able to hold 64-bit values when the program is running in 64-bit mode.