Are there anyway to initialize a large const array without typing every single elements within it, for instance:
trying to create a array:
const double A[1000] = {1.0/1, 1.0/2, 1.0/3,...,1.0/1000};
It's easy to do with a loop.
If it really has to be const and you have 1000 different values write some kiddy app/script to spit it out as a header file and prevent your typing! That gives you an easy way to modify the whole array initialisation later if need be too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With