C
C
Cloddy2015-12-22 22:31:21
C++ / C#
Cloddy, 2015-12-22 22:31:21

Address options a[i][j] in scanf?

How to express the cell address of a two-dimensional array for use in scanf?
There are two options
1) scanf("%lg",&a[i][j]);
2) scanf("%lg",a[i]+j);
We need two more options. Which?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Wolf, 2015-12-22
@Cloddy

1) &a[i][j]
2) a[i] + j
3) *(a+i)+j
4) &(*(a+i))[j]
Thanks, I didn't know that before your question (more precisely, I knew, but I had already forgotten as unnecessary). Updated the information in my head.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question