I'm struggling to find the answers to these simple questions.
1. Let's make a 1-D array:
Now, is there a way of performing operations on certain elements in the array.
eg. Can we set elements 15 to 25 to equal 7, say?
In a different language (IDL, which is fortran based) i would do something like:
but is there a way to do this in C++?
2. Then let's consider a 2-D array:
Is there a way to perform an operation on all the rows of a particular column (i may have got the column/row order mixed up, but hopefully you'll get what i mean). Again, i would have previously done something like:
1 2 3 4 5 6 7 8 9 10 11
|
y[10,*] = 7;
//i know this doesn't work, so i tried:
y[10][*] = 7;
//again, didn't work
y[10][];
//nor this
|
So, is there a way of doing this?