I have an array of structs. Actually, it is a 2d-array but an unusual 2d array.
I am allocating memory on stack:
#define MAX_VERTICES 5068
struct ARRAY_FIX {
int ele[MAX_VERTICES];
int size;
int first;
};
ARRAY_FIX C[MAX_VERTICES];
int main() {
//...
}
So, I need to replace one row with another one (actually, i need this operation to be performed for sorting rows by some criteria).

How is it possible to perform? As I understand, if I use this code:
С[i] = C[j];
In this code, the operator "=" will copy all array, won’t it? I needn’t it, I want to change the rows by changing the pointer
How can I do it?
In your case, each row is represented by
struct ARRAY_FIXobject. If you want to be able to work with these rows by using references (changing the order of rows by swapping pointers etc.), your 2D array must be stored in a way that allows you to do that.Possible solution is to change your 2D array to an array of pointers to
struct ARRAY_FIXso that when you callС[i] = C[j];only the reference (address of your object) is copied, not an object itself.Also note, that you should worry about the performance and try to make your program faster only when it’s really needed. It’s much easier to make a correct program fast than it’s to make a fast program correct.