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, 21.06.2019 19:30
Asalesman at a high end computer security firm want to sell you a proactive cover for your passport, which contains an rfid tag inside storing your sensitive information. the salesperson's solution cost only $79.99 and protects your passport from being read via radio waves while it is in your pocket. explain how you can achieve the same thing under $3.00
Answers: 3
question
Computers and Technology, 22.06.2019 15:30
Whats are the different parts of no verbal comunication, especially body language?
Answers: 3
question
Computers and Technology, 22.06.2019 23:30
Which text format is this, "the text is transcribed exactly as it sounds and includes all the utterances of the speakers. "?
Answers: 2
question
Computers and Technology, 23.06.2019 14:00
How are stop motion special effects in animated films created
Answers: 1
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
Mathematics, 11.01.2022 14:00
question
Mathematics, 11.01.2022 14:00
question
Mathematics, 11.01.2022 14:00
question
Mathematics, 11.01.2022 14:00
question
Mathematics, 11.01.2022 14:00
question
World Languages, 11.01.2022 14:00
question
Mathematics, 11.01.2022 14:00