Is int a 2 3 1,2 , 3,4 , 5,6 the correct assignment?

Updated on educate 2024-04-02
17 answers
  1. Anonymous users2024-02-07

    Here a[2][3] represents 2 rows and 3 columns, and when you assign the value, it is 3 rows and 2 columns, which means that your number of rows is out of bounds, so it is not possible, the number of rows can only be less than or equal to 2, and the number of columns can only be less than or equal to 3, I hope you can understand.

  2. Anonymous users2024-02-06

    I think this is wrong, the landlord can take a look at the following **, you can find the problem, I hope it will help you.

    #include

    void main(), in fact, if you put this sentence in a global variable, the result will be the same.

    for(int i=0;i<2;i++)

    for(int j=0;j<3;j++)

    printf("%d",a[i][j]);

    d:\ error c2078: too many initializers

    d:\ fatal error c1004: unexpected end of file found

    There was an error executing .

    1 error(s), 0 warning(s)

  3. Anonymous users2024-02-05

    Wrong, because there are only 2 lines, but the value is given 3 lines.

  4. Anonymous users2024-02-04

    No way? If I'm not mistaken, it should be 2 rows and 3 columns, and the value behind it is 3 rows and 2 columns, which should be wrong, and I used to take the 2nd level, I don't remember much, you think about it in this direction, I'm sorry.

  5. Anonymous users2024-02-03

    The 0int type defaults to 0, and this initialization is equivalent to int a[3] = , , or int a[ ]3] = ,,}

    The second-dimensional parameter is 3, but when assigning the value, all three have only one integer, and the other two default padding 0 is equivalent to int a[3][3]=,,}

    So a[1][2] = 0;

  6. Anonymous users2024-02-02

    2 This is a two-dimensional array, 2 in a[2][3] is the number of rows of the array, 3 is the number of columns int a[2][3]=,}; Equivalent to 1 0 0 2 3 0 Since the subscript in the array starts from 0, a[1][0] represents the 2 (1+1) rows in the array, and the 2. in the 1 (0+1) column.

  7. Anonymous users2024-02-01

    int a[ ]3]=,,}

    The second dimension parameter is 3, but when you assign the value, all three have only one integer, and the other two are filled with 0 by default

    Equivalent to int a[3][3]=,,}

    So a[1][2] = 0;

  8. Anonymous users2024-01-31

    It's not random, it's 0

    This initialization method is called "incomplete initialization" of the array, in the words of "C and Pointers".

  9. Anonymous users2024-01-30

    int a[ ]3] We only know that the number of columns is 3, we don't know the number of rows, but there are only three values, which must be arranged sequentially, horizontally. It can only be arranged in this way, and the other fill in 0. There is also a[1][2], so fill in 0 for rows above 2

  10. Anonymous users2024-01-29

    In the problem, a two-dimensional array a[3][2] is defined, and after initialization as, a pointer variable p is defined to point to a[1], which is the first address of the one-dimensional array.

    Then, p plus 2 points to the first address of the one-dimensional array, and *(p+2) points to the value of the address, i.e., 1. Therefore, *(p+2) has a value of 1.

    It should be noted that the expression "int+a[3][2]" in the title is the wrong Pizhou, and it should be "int a[3][2]" to be the correct syntax.

  11. Anonymous users2024-01-28

    According to the title, the kernel pointer p points to a[1], which is the first element of the second line in the array, which is 4. (p+2) means that p moves 2 elements backwards, and the thick in the feast points to a[1][2], which is the element 3 behind Zhenzhen 4, so the value of (p+2) is 3.

  12. Anonymous users2024-01-27

    a[1] points to the first element of the second row, which is 4. Therefore, p+2 will point to the three elements of the second row's ascending field, i.e. 3. Therefore, the value of *(p+2) is 3.

  13. Anonymous users2024-01-26

    Summary. First of all, find the sequence, which is equal to 3, because the sequence of the array starts from 0, so 3 corresponds to the fourth number, which is 12 ha.

    inta;, then a[6 2]=

    Okay, wait a minute, I'll get back to you as soon as I'm done.

    Good. a[6/2]=a[3]=12

    How do you calculate it?

    To the process. First of all, find the sequence, which is equal to 3, because the sequence of the array starts from 0, so 3 corresponds to the fourth number, which is 12 ha.

    Each number in the array corresponds to the ordinal number 0 1 2 3 4 5

  14. Anonymous users2024-01-25

    int a[4]; a[4]=5;Can it be assigned like this?

    Hello dear and happy to answer for you. int a[4]; a[4]=5;In addition to assigning values to array elements one by one with assignment statements, the method of assigning values to arrays can also adopt the methods of initial assignment and dynamic assignment. The C language also has the following provisions for the initial assignment of arrays:

    1) It is possible to assign an initial value to only some elements of lead wax. When the number of median values is less than the number of elements, only the previous elements are assigned. For example:

    int a[10]=;It means that only 5 elements of a[0] a[4] are assigned a value of finch, and the last 5 elements are automatically assigned a value of 0. 2) You can only assign values to elements one by one, and you can't assign values to the entire array as a whole. For example, if you assign a value of 1 to all ten elements, you can only write it as:

    int a[10]=;It cannot be written as: int a[10]=1; Multi-dimensional arrays are also the same way to assign values to arrays, in addition to using initialization assignments, using assignment statements to assign values to array elements can only be assigned one by one, the above is all the answers of the answerer, I hope to help you, I wish you a happy life

  15. Anonymous users2024-01-24

    a[1][2] is the third element of the second group of numbers, which is 7

    a[2][3] is the 4th element of the 3rd group of numbers, which is 8

    What's wrong with being 15?

  16. Anonymous users2024-01-23

    It represents two rows and three columns, and the following table all starts from 0, so a represents the second row and the third column.

    The order is as follows: 1, 2, 3

    Apparently visible The value is 6

  17. Anonymous users2024-01-22

    Mathematics is not good, why don't you use easy language?

Related questions
8 answers2024-04-02

Pronunciation method: 1. When pronouncing, the voice and throat are used to sing, so the treble does not go up. >>>More

15 answers2024-04-02

The correct way to wash your hands is to wash your hands with running water, wash your hands thoroughly, rub your hands together, and control the time to wash your hands for about 10 seconds. Hand sanitizer or soap can be added when washing hands, but be sure to rinse well. Wipe with a clean towel after absorption. >>>More

26 answers2024-04-02

In winter, the car must be warmed up first, because after the car is parked for a long time, when it is started again, the upper part of the engine is in a state of no oil, and at the same time, the engine does not reach the working temperature, and the gasoline cannot be effectively burned completely due to the low temperature of the machine. If you drive with fuel at this time, it will cause wear and tear on pistons, cylinders, etc.

10 answers2024-04-02

Steamed crabs. Prepare the ingredients:

Crab, peppercorns, garlic, fresh turmeric, rice wine, aged vinegar. >>>More

7 answers2024-04-02

Exercising the correct stance and reducing the burden on your waist, are you doing it right?