Example of arrays pointers, Computer Engineering

Assignment Help:

Q. Example of arrays pointers?

General form of declaration of array in Fortran 90 is

type, DIMENSION(bound) [,attr] :: name

E.g. the declaration 

        INTEGER, DIMENSION(5): A

Declare an array A of size 5.

General representation of declaration of array in C is 

type array_name [size]

E.g. declaration A

   int A[10]

Declares an array of size 10.

Fortran 90 allows using particular sections of an array. To access a part of an array you require name of the array followed by two integer values splitted by colon enclosed in parentheses. The integer values symbolize indices of section needed. E.g. a (3:5) denotes to elements 3, 4, 5 of array, a(1:5:2) denotes to elements 1, 3, 5 of the array and b(1:3, 2:4) denotes to elements from rows 1 to 3 and columns 2 to 4.  In C there is just one type of array whose size is determined statically although there are provisions for dynamic allocation of storage by dynamic memory allocation functions such as malloc and calloc functions and pointers. In Fortran 90 there are 3 probable kinds of arrays depending on binding of an array to some amount of storage: Static arrays with fixed size at the time of declaration and can't be changed at the time of execution, Automatic arrays or Semi-dynamic arrays: the size is decided after entering a subroutine and arrays can be created to match the exact size needed however local to a subroutine and Allocatable arrays or Dynamic arrays: the size can be changed at the time of execution.


Related Discussions:- Example of arrays pointers

Define the analysis that determines the meaning of statement, Analysis whic...

Analysis which determines the meaning of a statement once its grammatical structure becomes known is termed as? Ans. The meaning of a statement when its grammatical structure b

Priority interrupt and synchronous bus, What is a Priority Interrupt? A...

What is a Priority Interrupt? Ans: A priority interrupt is a type of interrupt that establishes a priority over the many sources to determine which condition is to be serviced

What is concurrent control, What is concurrent control? Control resides...

What is concurrent control? Control resides concurrently in various independent objects, every a separate task. A task can wait for input but other task continues implementatio

What is data link layer, Q. What is Data link layer? Data link layer: ...

Q. What is Data link layer? Data link layer: data link layer is responsible for transmitting a group of bits between adjacent nodes. Group of bits is termed as frame. Network

Evaluation functions for cutoff search , Evaluation Functions for Cutoff Se...

Evaluation Functions for Cutoff Search - artificial intelligent Evaluation functions guess the score that may be guaranteed if a specific world state is reached. In chess, such

Explain naming convention constants, Explanation Constants are "variable...

Explanation Constants are "variables" that cannot be changed within a function- or script-body. The value will always be the similar during script-implementation. Syntax "AX

Graph has a minimum spanning tree already computed, Assume that a graph has...

Assume that a graph has a minimum spanning tree already computed.  How fastly can the minimum spanning tree be updated if a new vertex and incident edges are added to G? If the

What are two reasons for using layered protocol, What are two reasons for u...

What are two reasons for using layered protocol? Layered protocol implies protocols used into each layer are the layer's own business that is they don't influence protocol of a

Sorting using interconnection networks, The combinational circuits employ t...

The combinational circuits employ the comparators for comparing the numbers and storing them on the basis of maximum and minimum functions. Likewise in the interconnection networks

Granularity and , Granularity In parallel computing, granularity is a ...

Granularity In parallel computing, granularity is a important measure of the ratio of computation to communication. Coarse Granularity: relatively huge amounts of computa

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