Computers and Technology
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])

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 03:00, TamB01
How can i clip a picture to a question on the computer?
Answers: 1
image
Computers and Technology, 22.06.2019 18:30, Angelanova69134
Technician a says that a shop towel should never be used to clean around the flange area before replacing an automatic transmission filter. technician b says that a dimpled transmission fluid pan can be repaired. who is right
Answers: 3
image
Computers and Technology, 23.06.2019 08:30, Bradgarner772
Based on your knowledge of a good network, describe what you think is a perfect network would be. what kind of information and resources could users share on this network. what would the network administrator do? what kind of communication would be used?
Answers: 1
image
Computers and Technology, 23.06.2019 18:30, bsept1018
Report all segments of identity by descent longer than 20 polymorphisms between pairs of individuals in the following cohort of 15 individuals across 49 polymorphisms: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 numeric input 2 points possible (graded) you have 2 attempts to complete the assignment below. for example if the sequence is "bcd", which occurs in "abcdef" , the starting point would be 2 (b), and the finishing point would be 4(d). individuals 7,10 between positions
Answers: 1
Do you know the correct answer?
Can anyone give a good explanation about my C++ homework? Thank you! We've seen that C++ stores sta...

Questions in other subjects:

Konu
Mathematics, 21.04.2020 17:48