Answer to Question #283126 in C++ for Rasheed Osman

Question #283126

Question 2 (15 marks) 300-500 words per discussion and avoid plagiarism. Discuss the following.

a. b. c. d. e.

Pointers Arrays Structures

Classes functions


1
Expert's answer
2021-12-28T01:31:39-0500

A pointer is a variable that stores a memory address as its value.

A pointer variable points to a data type (like int or string) of the same type, and is created with the  operator.


An array in C/C++ or be it in any programming language is a collection of similar data items stored at contiguous memory locations and elements can be accessed randomly using indices of an array. They can be used to store collection of primitive data types such as int, float, double, char, etc of any particular type. To add to it, an array in C/C++ can store derived data types such as the structures, pointers etc.


A structure is a user-defined data type in C/C++. A structure creates a data type that can be used to group items of possibly different types into a single type. 


 A class in C++ is the building block that leads to Object-Oriented programming. It is a user-defined data type, which holds its own data members and member functions, which can be accessed and used by creating an instance of that class. A C++ class is like a blueprint for an object.


A function is a group of statements that together perform a task. Every C++ program has at least one function, which is main(), and all the most trivial programs can define additional functions.




Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog