Coder Social home page Coder Social logo

cpp's Introduction

๐Ÿ“– C++

Random things learned from the cpp projects

CPP 00

namespace:

gruping related declarations(functions, variables etc) together under a single name to prevent collisions if different libraries are using the same names for their variables or functions etc.

class:

a class is a user-defined type that encapsulates data and functions that operate on that data. The data and functions are combined into a single unit, and objects can be created from the class to represent instances of that unit.

private:

can be accessed only inside of the class

public:

can be accessed from anywhere, even from outside of the class

constructor: initialize the data members of the object, either way to default values or initialize to the passed parameters in the constructor. Has the same name as the class and no return type

destructor: called when the the object is being destroyed and it frees up everything what should been freed. It takes no arguments neither returns anything

ex00: simple function to convert the input into uppercase and return it.

ex01: creating a phonebook where you can:

add new contacts up to 8

search for contacts and

exit

ex 02:

here you need to recreate the account file based on the test and the way you can do it will be similiar the way to create the phonebook, but of course a bit different.

CPP 01

ex00: Creating a zombie

ex01: creating a horde of zombies

ex02:

CPP 02

By overloading operators, you can make your classes behave like built-in types and define intuitive and concise syntax for operations on objects of your class.

To overload an operator, you define a special member function or a global function that has the same name as the operator you want to overload. The syntax for overloading operators depends on whether you are overloading them as member functions or as global functions.

Ad-hoc polymorphism, also known as function overloading or method overloading, is a feature in programming languages that allows multiple functions or methods with the same name but different parameter types or a different number of parameters to be defined. It enables a single function or method name to have different implementations based on the types or number of arguments passed to it.

In ad-hoc polymorphism, the appropriate function or method implementation is determined based on the types or number of arguments at the time of function or method invocation. The compiler or runtime system selects the most suitable version of the function or method based on the provided arguments.

The basic idea behind binary space partitioning is to split a space (such as a 3D scene or a 2D polygonal region) into two halves repeatedly until a desired condition is met. This process creates a binary tree structure where each node represents a region of space, and the splitting planes or lines divide the space into two child nodes.

CPP 03

Inheritance

cpp 04

Subtype polymorphism, abstract classes, interfaces

cpp 05

Exceptions (in short TRYing to CATCH what you f*cked up)

Dealing with Bureaucrats whom can create forms, but at the end creating a lot of form is boring, so we have to create an intern whom we can pass any form and he will create it, then he need to be able to sign these forms based on the grades they have and also execute them.

cpp 06

Static casting in different ways

cpp 07

Templates

A way to write felxible and reusable code

cpp 08

An intro to templated containers, iterators, algorithms

cpp 09

Reverse Polish notation

cpp's People

Contributors

zstenger93 avatar

Stargazers

 avatar

Watchers

 avatar

cpp's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.