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 the ''blocking factor'' of a file, The "blocking factor" of a file ...

The "blocking factor" of a file is? Ans. The number of logical records in single physical record is called the "blocking factor" of a file.

Introduction to computers, explain classification of computers in detail.al...

explain classification of computers in detail.also explain various application areas of computers

How to convert binary to octal and hexadecimal, Q. How to convert Binary to...

Q. How to convert Binary to Octal and Hexadecimal? Rules for these conversions are simple. For converting binary to octal binary number is splitted in groups of three, that are

Explain automated and manual systems, Q. Explain Automated and Manual syste...

Q. Explain Automated and Manual systems? Automated and Manual systems: The system that doesn't need human intervention is known as'Automated system'. In this system whole proce

Why are arrays usually processed with for loop, The real power of arrays co...

The real power of arrays comes from their facility of using an index variable to traverse the array, accessing every element with the similar expression a[i]. All the is required t

Smallest and largest integer , A given microprocessor has words of 1 byte. ...

A given microprocessor has words of 1 byte.  What is the smallest and largest integer that can be characterized in the following representations?   a) unsigned b) sign- ma

Average enzyme activity , Activity of a some  enzyme was calculated  in ext...

Activity of a some  enzyme was calculated  in extracts from brain, heart and lung. In every  tissue,  the activity was calculated  various  times, giving the following results (in

Computer architecture, what is complex instruction set computer and reduce...

what is complex instruction set computer and reduced complex instruction set computer

What are the special features of direct rdram, What are the special feature...

What are the special features of Direct RDRAM? It is a two channel Rambus It has 18 data lines intended to transfer two bytes of data at a time There are no divide

Why erlang is used, Erlang is used to (A) Measure busy period         ...

Erlang is used to (A) Measure busy period                (B) Give total busy period in minutes (C)  Measure average call rate       (D) Indicate total call period Ans

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