Questions tagged [array-pointer]

18 questions
0
votes
2 answers

how to shrink an array if two consecutive numbers in an array are equal then remove one and increment other

How to shrink an array if two consecutive numbers in an array are equal then remove one and increment other Example 1: int a[6]={2,2,3,4,4,4}; // Output: 6 Example 2: int b[7]={1,2,2,2,4,2,4}; // Output: {1,3,2,4,2,4}
0
votes
1 answer

Value of array pointer is getting changed after fopen

I am doing convolution operation for image. I have a problem in data stored in array pointer dynamically. The data in one of the array pointer variable is getting changed automatically after fopen function. I am getting array pointer from function…
0
votes
2 answers

Is it possible to find the address of the end of an array with a reference to the n+1th element?

I need to know when the pointer went through the whole array -> is on the first position behind it. Examplecode in c: unsigned int ar[10]; char *pointer = (char*) ar; while(pointer != (char*) &ar[10]){ *pointer++ = 0xff } Would this example work to…
Nemora
  • 13
  • 2
1
2