Questions tagged [array-address]

8 questions
2
votes
3 answers

Array's address with dimension greater than 3

What is the mathematical function that gives the address of an array with more than 3 dimensions? I already know that for an array a[x][y] with 2 dimensions is (a (x * max_second_dimension + y) * byte)
Metalingus
  • 25
  • 5
1
vote
3 answers

Passing multi-dimensional arrays to functions in C

Why is it necessary to specify the number of elements of a C-array when it is passed as a parameter to a function (10 in the following example)? void myFun(int arr[][10]) {} Is it so because the number of elements is needed to determine the address…
mrk
  • 3,061
  • 1
  • 29
  • 34
0
votes
0 answers

Finding address of a cell in 2d array

If the base address of a 2D array A[80][20] is 700, then find the address of cell A[1][18] if each cell contains 4 words and elements are arranged in column major order
0
votes
0 answers

where isimple_list_item_1 is declare in adapter parameters android java

In android application I am using adapter for populating ListView control like below: public class ChildActivity extends ActionBarActivity implements GetChildList { private ListView lv_child; @Override protected void onCreate(Bundle…
user3514596
  • 47
  • 1
  • 6
0
votes
2 answers

Expression must be modifiable lvalue

typedef struct state1_s { u8 size; u8 state; } state1_t; typedef struct state2_s { u8 size; u8 state[2]; } state2_t; typedef struct state3_s { u8 code; u8 count; }state3_t; I have these three structures. When i do the…
0
votes
5 answers

Adding to the address of an array in C

This is probably a very discussed question, but I still fail to understand the mechanics: How do I add 512 to the address of an array? Here's the situation: char buffer[512]; readSector(buffer,2); /*somewhere in here i must increment address of…
0
votes
1 answer

Why pointer is giving two different addresses?

I have this program. And I have some doubts. You can run it in your compiler. I am using gcc compiler in linux #include int main() { int j=4,*add; int i=2; int a[i][j]; for (i=0;i<=1;i++) { for(j=0;j<=3;j++) …
0
votes
1 answer

Point to specific value of an array

i have an array, int* array, with more than 10.000 int values, but i want to point to each 100 position, it means that I will have int ** matrix, where: matrix[i][j], I want i from my matrix to point to array[i * 100], how can y substitute the…
Florik
  • 1,260
  • 1
  • 12
  • 20