Write heterogeneous functions, Computer Engineering

Assignment Help:

Write "heterogeneous" functions

If a program uses simulated, dynamically allocated multidimensional arrays, it becomes possible to write "heterogeneous" functions which don't have to know (at compile time) how big the "arrays" are. In other words, one function can operate on "arrays" of various sizes and shapes. The function will look something like

func2(int **array, int nrows, int ncolumns)

{

}

This function does accept a pointer-to-pointer-to-int.(We must not call this function on arrays like the "true" multidimensional array like a2 ). The function also accepts the dimensions of the arrays as parameters, so that it will know how many "rows" and "columns" there are, so that it can iterate over them correctly. Here is a function which zeros out a pointer-to-pointer, two-dimensional "array":

 


Related Discussions:- Write heterogeneous functions

What is a linker program, What is a linker program? Ans. links the prog...

What is a linker program? Ans. links the program with other programs required for its execution is called a linker program.

What are various ids associated with a process, What are various IDs associ...

What are various IDs associated with a process? Unix identifies each process with a unique integer known as ProcessID. The process that implements the request for creation of a

What is sensitivity list, What is sensitivity list? A list of signals w...

What is sensitivity list? A list of signals which trigger execution of the block when they change value. Sensitivity list  indicates that when a change occurs to any one of

Area under curve , Write a program to find the area under the curve y = f(x...

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

How do you traverse a btree in backward in-order, Put the node in the right...

Put the node in the right subtree Then, Put the root  Put the node in the left subtree

Explain telnet, Explain Telnet Telnet is a Remote Login.

Explain Telnet Telnet is a Remote Login.

Explain about barrier, Q. Explain about Barrier? Barrier: No actual tra...

Q. Explain about Barrier? Barrier: No actual transfer of data takes place in this mode unless all the processors involved in the communication execute a particular block, calle

Determine maximum possible time of 4-bit synchronous counter, A 4-bit synch...

A 4-bit synchronous counter uses flip-flops with propagation delay times of 15 ns each.  The maximum possible time required for change of state will be ? Ans. 15 ns since in sy

Why is fragmentation needed on internet not on a typical wan, Why is fragme...

Why is fragmentation needed on Internet not on a typical WAN? TCP/IP protocol utilizes the name IP datagram to demote to an Internet packet. The amount of data carried into a d

What is configuration, What is configuration?  Turing  machine  compute...

What is configuration?  Turing  machine  computes,  changes  occur  in  the  current  state,  the  current  tap contents  and  the  current  head  location. A  setting  of  the

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd