
Concept explainers
Write C++ code (perhaps around 20-30 lines of code) and make it compile and run showing how to use it. It can be a single code example, or multiple code examples to demonstrate the following.
a. char
b. short
c. int
d. sizeof
e. typedef
f. enum
g. struct
h. union
i. pointer

Algorithm:
1. Declare a char variable c and assign it a value of 'A'.
2. Declare a short variable s and assign it a value of 123.
3. Declare an int variable i and assign it a value of 123456.
4. Print the size of each of the above variables in bytes.
5. Define a new type myInt as an alias for int.
6. Declare an enum Color and assign it a value of RED.
7. Declare a struct Point with two int variables x and y, and assign them values of 1 and 2 respectively.
8. Declare a union Data with an int and float variable, and assign the int variable a value of 42.
9. Declare an int variable j and assign it a value of 10.
10. Declare a pointer to int and assign it the address of j.
11. Print the value pointed to by the pointer.
12. End.
Step by stepSolved in 4 steps with 3 images

- Write In c++arrow_forwardI have seen some solutions to this problem in Bartleby's library that make no sense to me. I am learning C++, more specifically working with dynamic integers and have become confused with what has been provided previously by others. Using dynamic integers, can I get help with creating a class named 'largeIntegers' so that an object of this class can store an integer of any number of digits. If I could get help with setting up operations to add, subtract, multiply, and compare integers stored in two objects. Also, if someone could explain and help myself create constructors to properly initialize objects and functions to set, retrieve, and print the values of objects. There are three files I am working with: main.cpp, largeIntegers.h, and largeIntegers.cpp largeIntegers.cpp #include <iostream> using namespace std; largeIntegers.h //Specification file largeIntegers.h #ifndef H_largeIntegers #define H_largeIntegers #include <iostream> using namespace std;…arrow_forwardMust be in C# and this assignment only Rare Collection. We can make arrays of custom objects just like we’vedone with ints and strings. While it’s possible to make both 1D and 2D arrays of objects(and more), for this assignment we’ll start you out with just one dimensional arrays.Your parents have asked you to develop a program to help them organize the collectionof rare CDs they currently have sitting in their car’s glove box. To do this, you will firstcreate an AudioCD class. It should have the following private attributes. String cdTitle String[4] artists int releaseYear String genre float conditionYour class should also have the following methods: Default Constructor: Initializes the five attributes to the following default values:◦ cdTitle = “”◦ artists = {“”, “”, “”, “”}◦ releaseYear = 1980◦ genre = “”◦ condition = 0.0 Overloaded Constructor: Initializes the five attributes based on values passedinto the formal parameters◦ If condition is less than 0.0 or greater than 5.0,…arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





