为您找到"
...main( ) { int a[3][3]={{1,2},{3,4},{5,6
"相关结果约100,000,000个
@AnT I am expecting the output as "2 3 3 4" because I think initially the ptr is pointing to the first row of double dimensional array "a". Therefore (*ptr)[1] of first printf will give us 2, like wise (*ptr)[2] will give us 3.But after the ++ptr line it will start pointing to the second element of the first row of a[][3].Therefore (*ptr)[1] of second line should now give us 3 and likewise ...
QUESTION C The correct answer for the given question is option a: 2 3 5 6 Given an array a of 2-dimensional with number of columns 3 and number of rows isn't specified. As array a is declared with values {1,2,3,4,5,6}, hence 1st row of array cont …View the full answer
#include int main() { int a[][3] = {1, 2, 3, 4, 5, 6}; int (*ptr)[3] = a; printf("%d %d ", ... (b) 2 3 4 5 (c) 4 5 0 0 (d) none of the above
void main() { int a[3][3]={{1,2,3},{4,5,6},{7,8,9}}; foo(a); printf("%d",a[2][1]); }foo(a);是用a调用函数foo,在foo中b就指向了a[0](就是a数组中的1的位置),++b使b指向了a[1](就是a数组中的4的位置
Extra Info that i want to add: Here &x means address of whole 2-d array though it will show same address as x or *x or &(x[0][0]), *(&x) is same as (&x[0]) which is base addr. of whole array of 3 elements which is same as x and *x is equal to **(&x) which is same as &(x[0][0]) which address of first element of 3 element array.
This set of C Multiple Choice Questions & Answers (MCQs) focuses on "Multidimensional Arrays - 1". Pre-requisite for C Multidimensional Arrays MCQ set: Video Tutorial on 2-Dimensional Arrays.
a is 3D array with size [3][3][3] Therefore each 2D array contains 9 elements, we have 3 such arrays. 0th 2D array have {1,2,3,4,5,6,7,8,9} 1st 2D array have {10,11,12,13,14,15,16,17,18}
Step 1: int a[5] = {5, 1, 15, 20, 25}; The variable arr is declared as an integer array with a size of 5 and it is initialized to. a[0] = 5, a[1] = 1, a[2] = 15, a[3] = 20, a[4] = 25.. Step 2: int i, j, m; The variable i,j,m are declared as an integer type.. Step 3: i = ++a[1]; becomes i = ++1; Hence i = 2 and a[1] = 2. Step 4: j = a[1]++; becomes j = 2++; Hence j = 2 and a[1] = 3.
main ( ) {static float a [ ] = {13.24, 1.5, 4.5, 5.4, 3.5} float *j, *k; j = a; k = a + 4 j = j * 2; k = k/2; printf("% f% f', *j, *k): } Q2. Which of the following expression will delete the entire array pointed to by q?
Consider the following program of 'C' main ( ) {static int a [ ] = { 1, 2, 3, 4, 5, 6, 7, 8 } ; int i; for(i = 2; I < 6; ++i) a [a [i] ] = a [i];