In general, I fixed it, through the link, it works: P
Place of function declaration
void color_prohod1(GLfloat *cwet_chikl, int b);
Place call function
GLfloat cwet_chikl[360]; color_prohod1(cwet_chikl, 360);
The function itself. Assigning the function of coloring the "drawing" line in the rainbow range of colors.
void color_prohod1(GLfloat *cwet_chikl, int b) { int t1 = b/30; int t2 = b%30; int prohod = t1/7; qDebug() << "t1 = b/30: " << t1; qDebug() << "t2 = b%30: " << t2; qDebug() << "prohod = t1/7: " << prohod; int s =0; // элемент "позиция " массива прим: ranbow_color[124]; s ==124; int i = 0; int i_t1 = 0; for (int a_g =0; a_g < prohod+1; a_g++) { qDebug() << "2444!!!!!!!!!!!!!!!a_g:" << a_g; if (i == 0) { i = 1; GLfloat per = 0.0; for (int a = 0; a < 10 ; a++) { for (int a_i = 0; a_i < 3; a_i++) { if(a_i == 0) { per += 0.1f; cwet_chikl[s] = per; s++; } if(a_i == 1) { cwet_chikl[s] = 0.0f; s++; } if(a_i == 2) { cwet_chikl[s] = 0.0f; s++; } } } qDebug() << "tyt i:" << i << " cwet_chikl[" << s << "]" << cwet_chikl[s]; i_t1 = i_t1 +1; if(t1 <= i_t1) continue; } if(i == 1){ i = 2; GLfloat per = 0.0; for (int a = 0; a < 10 ; a++) { for (int a_i = 0; a_i < 3; a_i++) { if(a_i == 0) { cwet_chikl[s] = 0.0f; s++; } if(a_i == 1) { per += 0.1f; cwet_chikl[s] = per; s++; } if(a_i == 2) { cwet_chikl[s] = 0.0f; s++; } } } qDebug() << "tyt i:" << i << " cwet_chikl[" << s << "]" << cwet_chikl[s]; i_t1 = i_t1 +1; if(t1 <= i_t1) continue; } ... if (i == 6) { i = 0; GLfloat per = 0.0; for (int a = 0; a < 10 ; a++){ for (int a_i = 0; a_i < 3; a_i++){ if(a_i == 0){ per += 0.1f; cwet_chikl[s] = per; s++; } if(a_i == 1){ cwet_chikl[s] = 0.0f; s++; } if(a_i == 2){ cwet_chikl[s] = 0.0f; s++; } } } qDebug() << "tyt i:" << i << " cwet_chikl[" << s << "]" << cwet_chikl[s]; i_t1 = i_t1 +1; if(t1 <= i_t1) continue; } } // выводим одноцветно int i_t =0; for(int i1 = 0;i1 < t2;i1++) { if(i_t == 0) { cwet_chikl[s] = 0.8f; s++; i_t = 1; } else if(i_t == 1) { cwet_chikl[s] = 0.21f; s++; i_t = 2; } else if(i_t == 2) { cwet_chikl[s] = 0.14f; s++; i_t = 0; } } }

The simplest example of working with pointers
#include <stdio.h> #include <stdlib.h> #include <string.h> void addOne(float *buf, int N); int main() { float A[5] = {1.0f, 2.0f, 3.0f, 4.0f, 5.0f}; float *B[5]; // заполним массивы printf("vvod A \n"); addOne(&A, 5); // по адресу printf(" vvod B \n"); addOne(B, 5); // по указателю printf("game ower"); system("pause>null"); return 0; } void addOne(float *Buf, int N) { // memset(Buf, 0, sizeof(Buf)); for (int n = 0; n< N; n++) { Buf[n] = Buf[n] + 1.0f; printf("%f, \n", Buf[n]); } printf("\n"); }

I noticed that the question intersects with the standard simple question how to put an array into an array. In general, I use two methods. First: brute forcefully
float S[5] = {1.0f, 2.0f, 3.0f, 4.0f, 5.0f}; float C[5] = {0.0f, 0.0f, 0.0f,0.0f, 0.0f}; for (int i = 0; i < 5; i++){ C[i] = S[i]; printf("%f, \n", S[i]); }
second (more often): memcpy function
float S[5] = {1.0f, 2.0f, 3.0f, 4.0f, 5.0f}; float C[5] = {0.0f, 0.0f, 0.0f,0.0f, 0.0f}; memcpy (C, S, sizeof(float)*5);