Wednesday 7 April 2021

Array Types Part 3 | PPL | Sebesta | Elementary Data Types in Programming Language

                 In this post, we will see Array Types Part 3 | PPL | Sebesta | Elementary Data Types in Programming Language | array types, data types in ppl, data types ppl, elementary data types in programming language, ppl, sebesta  


IV. Array Initialization:

 

i. C / C++

int list [] = {4, 5, 7, 83};

char name [] = "freddie";

char *names [] = {"Bob", "Jake", "Darcie"};

 

ii. Java

int list [] = {4, 5, 7, 83};

String[] names = ["Bob", "Jake", "Darcie"];

 

iii. Ada

List : array (1..5) of Integer := (1, 3, 5, 7, 9);

Bunch : array (1..5) of Integer := (1 => 17, 3 => 34,

others => 0);

 

V. Array Operations

              The most common array operations are assignment, catenation, comparison for equality and

inequality, and slices.

 

              The C-based languages do not provide any array operations, except through the methods of Java, C++, and C#.

 

              Perl supports array assignments but does not support comparisons.

 

              Python’s arrays are called lists.

              Python provides array assignment.

              Python also has operations for array catenation ( + ) and element membership ( in ).

              Comparison is done by ( == ) and ( is ).


Watch following video:

Watch on YouTube: https://www.youtube.com/watch?v=VwGkTshxAcM

No comments:

Post a Comment