Skip to content
the poor coder

Home / Topics / #c

#C++

34 posts · page 2 of 2
2020

Hackerrank Box It! Solution

Design a class named Box whose dimensions are integers and private to the class. The dimensions are labelled: length , breadth , and height . The default constructor of the class should initialize , , and to . The…

2020

Hackerrank Classes and Objects Solution

A class defines a blueprint for an object. We use the same syntax to declare objects of a class as we use to declare variables of other basic types. For example: Kristen is a contender for valedictorian of her high…

2020

Hackerrank Class Solution

Classes in C++ are user defined types declared with keyword class that has data and functions . Although classes and structures have the same type of functionality, there are some basic differences. The data members of…

2020

Hackerrank Structs Solution

struct is a way to combine multiple fields to represent a composite data structure, which further lays the foundation for Object Oriented Programming. For example, we can store details related to a student in a struct…

2020

Hackerrank Strings Solution

C++ provides a nice alternative data type to manipulate strings, and the data type is conveniently called string. Some of its widely used features are the following: Declaration: Size: Concatenate two strings: Accessing…

2020

Hackerrank StringStream Solution

stringstream is a stream class to operate on strings. It basically implements input/output operations on memory (string) based streams. stringstream can be helpful in different type of parsing. The following…

2020

Hackerrank Pointer Solution

A pointer in C is a way to share a memory address among different contexts (primarily functions). They are primarily used whenever a function needs to modify the content of a variable, of which it doesn't have…

2020

Hackerrank Functions Solution

Functions are a bunch of statements glued together. A function is provided with zero or more arguments, and it executes the statements on it. Based on the return type, it either returns nothing (void) or something. A…

2020

Hackerrank For Loop Solution

A for loop is a programming language statement which allows code to be repeatedly executed. The syntax for this is expression_1 is used for intializing variables which are generally used for controlling terminating flag…

ESC