K
kiddler
I'm sorta new to the C++ syntax.
I know that arrays can be delcared like so:
int a[]={1,2,3,4};
but what if I want the array to be a global, and then set the length
and value inside a method?
like in java, you can do:
int a[];
void main()
{
a=new int{1,2,3,4};
}
How do I do that in C++?
I know that arrays can be delcared like so:
int a[]={1,2,3,4};
but what if I want the array to be a global, and then set the length
and value inside a method?
like in java, you can do:
int a[];
void main()
{
a=new int{1,2,3,4};
}
How do I do that in C++?