How to allocate array using malloc



I want to allocate arrays that can store 10**9 variables , how do I do it ?
Here’s how I’m doing ,think it’s not working
int *arr;
arr= (long long )malloc(100000sizeof(long long))
Anyone , any opinions/suggestions on this ?


declare int arr as pointer array(*arr) then it will work


Allocating memory to array using malloc is the way of dynamically allocating memory .
An example of a c programme to allocate memory to an integer array using malloc is given
int main()
{ int n;
printf(“Enter the size of array
int *array=(int )malloc(nsizeof(int)); //malloc syntax
return 0;