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
What is a word processor in ms word​
marysya [2.9K]

A word processor is software or a device that allows users to create, edit, and print documents. It enables you to write text, store it electronically, display it on a screen, modify it by entering commands and characters from the keyboard, and print it. Of all computer applications, word processing is the most common.

6 0
3 years ago
Read 2 more answers
Explain why this scenario could put an organization in jeopardy of losing some of its workforce.
Ksenya-84 [330]

Answer:

Not educating its employees on the new software.

8 0
3 years ago
In which situations would it be most helpful to filter a form? Check all that apply.
Paladinen [302]

Answer: hey did you find the answer? Do you mind telling me it?

Explanation:

8 0
3 years ago
Which item can be added to Outlook messages, like a Word document or PowerPoint presentation, that takes standard bulleted lists
Sonja [21]

Answer:

WordArt

Explanation:

Took exam

4 0
2 years ago
Test unit 8 edhesive answers ​
True [87]
What are the questions
7 0
3 years ago
Other questions:
  • Keyboard question: <br> How do I make the 'congruent to' symbol on this keyboard?
    8·1 answer
  • Can someone help me with this one
    9·2 answers
  • Which of the following correctly describes the function of an IP address
    13·1 answer
  • Advertising is organized around four distinct groups. The _____ group includes the photographers, the illustrators, video produc
    9·1 answer
  • Impanation stage contain ​
    10·1 answer
  • Greg is the network administrator for a large stadium that hosts many events throughout the course of the year. They equip usher
    7·1 answer
  • Write a method called sum with a while loop that adds up all numbers between two numbers a and b. The values for a and b can be
    11·2 answers
  • Disadvantages of computer. ​
    9·1 answer
  • A server is handling thousands of simultaneous connections, and proxying requests to another service. Which concurrency model is
    9·1 answer
  • each data mining technique has its advantages and limitations. which data mining technique mimics the neural structure of the br
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!