The python example is making copies. If that's okay for your use case, you could do something like this (I'm swapping out your vanilla arrays for std::vector):
#include <iostream>
#include <vector>
void somefunction(std::vector<int> v) {
std::cout << "vector has " << v.size() << " elements,"
<< " first value is " << *v.begin() << ","
<< " last value is " << *(v.end()-1) << std::endl;
}
int main() {
std::vector<int> a;
for (int i=0; i<65; i++) {
a.push_back(i);
}
somefunction(std::vector<int>(a.begin(),a.begin()+23));
somefunction(std::vector<int>(a.begin()+24,a.begin()+38));
somefunction(std::vector<int>(a.begin()+39,a.begin()+65));
}
which outputs:
vector has 23 elements, first value is 0, last value is 22
vector has 15 elements, first value is 23, last value is 37
vector has 27 elements, first value is 38, last value is 64
But it sounds like you can't use std::vector, because somefunction() has a signature you can't change. Luckily, you can do similar gymnastics just manually copying parts of the array, as below:
#include <iostream>
#include <string.h>
void somefunction(int v[], int len) {
std::cout << "vector has " << len << " elements,"
<< " first value is " << v[0] << ","
<< " last value is " << v[len-1] << std::endl;
}
int main() {
int a[65];
for (int i=0; i<65; i++) {
a[i] = i;
}
int b[23];
memcpy(b, a, 23*sizeof(int));
somefunction(b, 23);
int c[15];
memcpy(c, a+23, 15*sizeof(int));
somefunction(c, 15);
int d[27];
memcpy(d, a+38, 27*sizeof(int));
somefunction(d, 27);
}
which again outputs:
vector has 23 elements, first value is 0, last value is 22
vector has 15 elements, first value is 23, last value is 37
vector has 27 elements, first value is 38, last value is 64
somefunctionknow how large the array is?glTexCoordPointer()just passmy_array + n.glTexCoordPointer(). If you have any other code for drawing something after setting the texture you should add it to your question.