subject
Computers and Technology, 22.01.2021 19:30 Duriiee

Can anyone give a good explanation about my C++ homework? Thank you! We've seen that C++ stores statically-allocated multidimensional arrays in first-dimension-major order. Suppose, instead, that C++ stored them using last-dimension-major order (so, the opposite) instead. For example, suppose we had this statically-allocated array:

int a[3][2][2];
then suppose that its elements were stored contiguously in memory in exactly the following order — which, again, is different from how C++ normally does it.

a[0][0][0]
a[1][0][0]
a[2][0][0]
a[0][1][0]
a[1][1][0]
a[2][1][0]
a[0][0][1]
a[1][0][1]
a[2][0][1]
a[0][1][1]
a[1][1][1]
a[2][1][1]
If that was the rule in C++, then which of the following function declarations would we expect to be illegal? For each one that you would expect to be illegal, explain in a sentence or two why. (Note that I'm asking this question generally, so the answer is never going to be "Because the capacity of x is not the same as the capacity of a in your example.")

void func1(int x[10][3])
void func2(int x[][10][20])
void func3(int x[30][])
void func4(int x[40][][][])
void func5(int x[][10][])
void func6(int x[10][][20])

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 03:00
Data is processed, stored, and transmitted as a series of 1s and 0s. each 1 or 0 is called a(n) . a series of eight 0s and 1s, called a(n) , represents one character—a letter, number, or punctuation mark. data becomes when it is presented in a format that people can understand and use. digital signals are represented by two different , such as +5 volts and +.2 volts. digital data can also take the form of light and dark spots etched onto the surface of a cd or the positive and negative orientation of particles on the surface of a hard disk. data consists of numbers that might be used in arithmetic operations. it can be represented digitally using the number system. data is composed of letters, symbols, and numerals that are not used in arithmetic operations. computers represent this type of data using , ebcdic, unicode, or utf-8. data is quantified using terms such as or kibibyte (1024 bytes), and prefixes such as or mebi (1,048,576), and giga or (1,073,741,824). to reduce file size and transmission times, digital data can be compressed. compression provides the means to compress data and reconstitute it into its original state. compression throws away some of the original data during the compression process. compressed files usually have at the end of the file name and are represented with special icons. these files have to be or unzipped before you can view the data they contain.
Answers: 1
question
Computers and Technology, 22.06.2019 19:30
When creating a presentation in libre office impress, where does the editing of slides take place? a. the slides panel b. the center panel c. the tasks panel, under the masters pages tab d. the tasks panel, under the layouts tab
Answers: 3
question
Computers and Technology, 23.06.2019 06:30
How do you write an argumentative essay about the importance of free enterprise ?
Answers: 1
question
Computers and Technology, 23.06.2019 07:00
Why is investing in a mutual fund less risky than investing in a particular company's stock? a. mutual funds only invest in blue-chip stocks. b. investments in mutual funds are more liquid. c. mutual funds hold a diversified portfolio of stocks. d. investments in mutual funds offer a higher rate of return.
Answers: 2
You know the right answer?
Can anyone give a good explanation about my C++ homework? Thank you! We've seen that C++ stores sta...
Questions
question
Social Studies, 06.11.2020 22:30
question
Social Studies, 06.11.2020 22:30
question
English, 06.11.2020 22:30
question
Mathematics, 06.11.2020 22:30
Questions on the website: 13722361