Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - In C language, how many dimensions does a multidimensional array have at most? Our teacher said 60 dimensions at most? Excuse me, why?
In C language, how many dimensions does a multidimensional array have at most? Our teacher said 60 dimensions at most? Excuse me, why?
C language defaults to at most one two-dimensional array; Of course, if the memory is allocated by the pointer itself, it can also be calculated by itself and represented by more dimensions.

In principle, the number of elements contained in an array in C language can be arbitrary in theory. If you want to open a large array, such as int array int [10000] [10000]; Declaring an array in main () will make the application quit, but if you put the array declaration outside all function bodies and make it a global variable, there is no limit. You can open as many arrays as you want.

Extended data:

If the variable name is followed by a number bracket, the declaration is an array declaration. Strings are also arrays. They end the array with ASCII NULL. It should be noted that the index values in parentheses are counted from 0.

If a declared variable is preceded by an *, it indicates that it is a pointer variable. In other words, the variable stores an address, and * (especially monocular operator * here, the same below. There is also a binocular operator *) in C language, which is a content operator, meaning to take the content stored in this memory address. Pointer is one of the main characteristics that distinguish C language from other contemporary high-level languages.

Baidu encyclopedia -c language