1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Sav [38]
3 years ago
9

Can you answer this question?

Computers and Technology
1 answer:
patriot [66]3 years ago
3 0

Answer:

To do this you'll need to use malloc to assign memory to the pointers used.  You'll also need to use free to unassign that memory at the end of the program using the free.  Both of these are in stdlib.h.

#include <stdlib.h>

#include <stdio.h>

#define SIZE_X 3

#define SIZE_Y 4

int main(void){

       int **matrix, i, j;

       // allocate the memory

       matrix = (int**)malloc(SIZE_X * sizeof(int*));

       for(i = 0; i < SIZE_X; i++){

               matrix[i] = (int *)malloc(SIZE_Y * sizeof(int));

       }

       // assign the values

       for(i = 0; i < SIZE_X; i++){

               for(j = 0; j < SIZE_Y; j++){

                       matrix[i][j] = SIZE_Y * i + j + 1;

               }

       }

       // print it out

       for(i = 0; i < SIZE_X; i++){

               for(j = 0; j < SIZE_X; j++){

                       printf("%d, %d:  %d\n", i, j, matrix[i][j]);

               }

       }

       // free the memory

       for(i = 0; i < SIZE_X; i++){

               free(matrix[i]);

       }

       free(matrix);

       return 0;

}

You might be interested in
__________ may be defined as the application of methods and means to ensure that test results are reliable and valid, and errors
kow [346]

Answer:

Quality assurance

Explanation:

8 0
3 years ago
Design a Visual Logic flowchart for a program that prompts the user to enter ten numbers one at a time. After the user has enter
swat32
N = 0 

<span>1 read x </span>

<span>n = n + 1 </span>

<span>print x </span>

<span>If n > 1, go down to 2 </span>

<span>small = x </span>
<span>large = x </span>

<span>2 If x</= small, then small = x </span>
<span>If x>/= large, then large = x </span>

<span>If n < 12 , go back up to 1 </span>

<span>Print small </span>
<span>Print large </span>
<span>end</span>
8 0
3 years ago
What is the difference between software hardware ???
defon
Software are parts of a computer system that can be seen but not touched.

Hardware are parts of a computer system that can be seen and touched
3 0
3 years ago
Read 2 more answers
Usted repetir la pregunta?<br>O A. Es<br>B. Puede<br>C. Puedes<br>O D. Está​
puteri [66]

Answer:

I believe the answer is B. Puede

5 0
3 years ago
Read 2 more answers
\What will the weather most likely be like the day after a warm front? (4 points) The temperature will be cool or cold, and ther
poizon [28]

The temperature will be warm, and there will be no rain.

5 0
3 years ago
Read 2 more answers
Other questions:
  • 14. The data selected to create a table must include
    12·2 answers
  • The part of the inside of a computer
    14·1 answer
  • The internet is a worldwide assembly of computer
    11·1 answer
  • Create a program to calculate the wage. Assume people are paid double time for hours over 60 a week. Therefore they get paid for
    10·1 answer
  • What is the process called that occurs when you start up your computer? A Download B Restore C Boot D Copy
    12·2 answers
  • The "Rudolph Rule" is best described by which of the following?
    9·1 answer
  • Your computer has been showing signs of a malware infection, and today it started up in Safe Mode. Because your computer is not
    6·1 answer
  • How long will my chromebook last if it is at 30 percent
    9·1 answer
  • Cloud architects have been largely replaced by ScrumMasters.<br><br> True<br><br> False
    15·2 answers
  • Given a list of integers. find the size of the list
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!