Jump to content
Sign in to follow this  
SteveNi

Initalize array with range of numbers

Recommended Posts

Hi

I need an array wich stores a range of numbers, starting at zero and ending at @numpt (total amount of points in a geometry).

Is there a fast way to do this apart from filling the array in a for loop?

 

Thanks

Share this post


Link to post
Share on other sites

What's wrong with a for-loop? It's quick and readable.

You could do this but it's a lot uglier

int pts[] = sort(nearpoints(0, 0, 1e10));

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×