I want to pass a pointer to a multidimensional Array, so the value could be kept not copied. How can I do it? I also keep tracking the int count, will it work every time? The array that I need is memory. The struct has been declared before, outside the main.
struct registers
{
int data;
} registerX, registerY;
void first(int *counter, struct registers* X1, int **m)
{
int value;
printf("Enter the value for the X\n");
scanf("%d", &value);
X1->data = value;
m[*counter][1] = X1->data;
*counter = *counter++;
}
int main()
{
int memory[SIZE][2];
int count = 0;
int choice;
printf("Enter the instruction number:\n");
while(choice != 107)
{
scanf("%d", &choice);
if(choice == 101)
{
memory[count][0] = 101;
first(&count, ®isterX, &memory[count][1]);
}
&memory[count][1]isint *. receiveint *m, thenm[*counter][1] = X1->data;-->*m = X1->data;,*counter = *counter++;-->++*counter;or*counter += 1;*counter++meant*(counter++).++for increment pointer.++*counteris increment*counteri.e.(*counter)++.++*counteris not the same as(*counter)++.*counter += 1. I do not say to be the same.