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

How do you turn off cookies for one page in your site, How do you turn off ...

How do you turn off cookies for one page in your site?  Use the Cookie. Abandon Property which Gets or sets the discard flag set by the server. When true, this property instruc

What is file allocation table, Q. What is File allocation table? FAT ma...

Q. What is File allocation table? FAT maps the usage of data space of disk. It comprises information about space used by every individual file and unused disk space as well as

Determine the bios function with one illustration, Determine the BIOS funct...

Determine the BIOS function with one illustration BIOS stands for Basic Input Output System. It is a set of programs to provide most basic low-level services like services keyb

What is stack addressing, Q. What is Stack Addressing? In this addressi...

Q. What is Stack Addressing? In this addressing technique operand is implied as top of stack. It isn't explicit however implied. It employs a CPU Register known as Stack Pointe

Linux, Discuss the risks of having a single root user and how more limited ...

Discuss the risks of having a single root user and how more limited management abilities can be given to others users on Linux/UNIX systems

Difference between the fork -join and begin-end, Difference between the for...

Difference between the fork -join and begin-end. The fork - join keywords: Groups several statements together.Cause statements to be evaluated in parallel (all at the same

Disadvantages of edi(electronic data interchange), Disadvantages  1.  T...

Disadvantages  1.  The X12 standard is so large and general  2.  EDI communications negotiate a technical agreement to explain exactly what subset of EDI they will use

What do you mean by artificial intelligence, Q. What do you mean by artific...

Q. What do you mean by artificial intelligence? Show the artificial intelligence systems used widely in business. ANSWER: Artificial intelligence (AI) is the science of making

Handling a page in memory - computer architecture, Handling a Page: ...

Handling a Page: Typical page size today are 4 kb to 16 kb ,having tendency to use even larger page sized Organization that reduce the page fault rate are striking (comp

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