answersLogoWhite

0

How do you multiply two array using dynamic allocation?

Updated: 8/20/2019
User Avatar

Wiki User

10y ago

Want this question answered?

Be notified when an answer is posted

Add your answer:

Earn +20 pts
Q: How do you multiply two array using dynamic allocation?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you display matrix in c using dynamic memory allocation?

Memory allocation is not necessary to display a matrix.


Can a linked list implemented using an array be accessed by giving the location?

A linked list implemented with an array defeats the purpose of using a linked list, which is to address the memory allocation problems associated with arrays.


What is tunable array?

Arrays are the cheapest data structures, without much overhead compare to other data structures. Basically in array, we have four types i.e1. Static array - array size known at compile time.// example code snippet:char array[10];2. Dynamic array - array size known at begging of execution time.//example code snippet:char *array;int num_elements;//Dynamic memory allocation using malloc library call which in turn uses "brk" // or "sbrk" system call under unixarray = (char *)malloc (num_elements * sizeof(char));3. Stretchable array- array size can be stretched(modified) during execution time.//example code snippet.char *array;int num_elements;array = (char *)malloc (num_elements * sizeof(char));//Modify the memory allocation during execution time using realloc library callarray = realloc (array, new_value);4. Tunable array- array size known at link time.Suppose consider you have one object file called sample.o(compiled sample.c)and header file called sample.h.ISV's (Independent software vendors) usually won't provide you the source code(In case of proprietary software), instead they will provide you the object file and one corresponding header file which contains some symbolic literals (some # define constants). so that you can change the symbolic literals in header file which takes necessary action when you compile both file together.//example snippet code:In sample.cchar arr[MAX_SIZE];In sample.h# define MAX_SIZESuppose now if you change the symbolic literal "MAX_SIZE"in header file sample.h that will affect the size of the array arr at link time.Basically static array's are fall under the category of "Static Memory allocation" and remaining all will fall under "Dynamic Memory allocation".


A C program using dynamic memory allocation to sort n names in ascending order?

Writing a C program that uses dynamic memory allocation to sort names in ascending order is a typical computer science assignment. To write this program, you must be in UNIX.


Write a C program using dynamic memory allocation to find the sum of elements of a matrix?

Did you know that memory allocation is not needed to display the matrix? However, the C program is to find the sum of all the elements.


Difference between static array and dynamic array?

Dynamic memory allocation is at runtime. static memory allocation is before run time, but the values of variables may be changed at run time. Static memory allocation saves running time, but can't be possible in all cases. Dynamic memory allocation stores it's memory on heap, and the static memory allocation stores it's data in the "data segment" of the memory.


What is segmented page allocation?

Segmented page allocation is a type of memory management that uses base and bound registers to determine memory faults, similar to dynamic page allocation. More importantly it is different to dynamic page allocation since the entire process doesn't have to be in memory, similar to using virtual memory paging where the program is broken into pieces. Unlike virtual memory paging, the maximum virtual memory size is limited to the size of physical memory.


In C plus plus is it possible to instantiate an array without specifying a length?

No. You can declare a dynamic array without specifying a length, but in order to physically instantiate (either by using malloc or by using object-oriented construction) you must provide a length.


What is the difference between queues and circular queues?

A queue can use a dynamic array, or a linked list, but if using static memory, the queue becomes a circular queue because the underlaying data structure is a static circular array. This means the ends of the array are attached.


What complications are imposed if one tries to implement a dynamic list using a traditional homogeneous array?

in dynamic list after adding a new element size of the list disturbed so deletion and insertation is necessary to add a new element


Queue ADT Using Array?

implement the queue ADT using an array


What is dynamic mamory?

Dynamic memory refers to memory that is allocated and deallocated during program execution, as opposed to static memory which is allocated at compile time. In C and C++, dynamic memory allocation is done using functions like malloc() and free(), allowing for flexibility in managing memory resources at runtime. However, improper use of dynamic memory can lead to memory leaks or segmentation faults.