Skip to content

Instantly share code, notes, and snippets.

View javedbaloch4's full-sized avatar

Javed Baloch javedbaloch4

View GitHub Profile
@javedbaloch4
javedbaloch4 / overloading_delete_opt.cpp
Created June 20, 2020 18:04
C++ Without overloading delete operator, make an object of any of the above classes and delete it without calling destructor or using free()
#include <iostream>
using namespace std;
class A {
private:
public:
int a = 10;
@javedbaloch4
javedbaloch4 / virtual_destructor.cpp
Created June 20, 2020 16:48
The C++ using virtual destructor to avoid memory leaks.
// Written by Javed Ahmed - F2019266402
#include <iostream>
using namespace std;
class Base {
public:
virtual void func() {
cout << "Base Fun is called\n";
}
@javedbaloch4
javedbaloch4 / diamond_problem.cpp
Last active June 20, 2020 18:45
In general OOP diamond problem solution writing in C++.
// Written by Javed Ahmed - F2019266402
#include <iostream>
using namespace std;
class Animal {
public:
void eat() {
cout << "Animal is eating.\n";
}
@javedbaloch4
javedbaloch4 / operator_overloading.cpp
Created June 20, 2020 15:43
C++ overloading cout's << operator for length class
// Written by Javed Ahmed - F2019266402
#include <iostream>
using namespace std;
class Length
{
private:
int distance;
public:
Length(){
@javedbaloch4
javedbaloch4 / car.cpp
Created June 20, 2020 11:33
The C++ Car class to work increase/decrees speed and check the status.
// Writting by Javed Ahmed (F2019266402)
#include<iostream>
using namespace std;
class Car {
private:
int yearModel;
string make;
int speed;
@javedbaloch4
javedbaloch4 / polymorphism.cpp
Created June 19, 2020 22:52
C++ Run Time Polymorphism example with Customer & Customer Data class.
// Writting by Javed Ahmed (F2019266402) - June 20 2020 3: 50 AM
#include<iostream>
using namespace std;
class PersonData {
private:
string firstName;
string lastname;
string address;
@javedbaloch4
javedbaloch4 / listOfCitiesOfPakistan.php
Created June 8, 2020 22:06
PHP Array of List of All Cities of Pakistan.
$balochistan = [
'Awaran','Barkhan','Chagai','Dera Bugti','Gwadar','Harnai','Jafarabad','Jhal Magsi','Kacchi','Kalat','Kech','Kharan','Khuzdar',
'Killa Abdullah','Killa Saifullah','Kohlu','Lasbela','Lehri','Loralai','Mastung','Musakhel','Nasirabad','Nushki','Panjgur',
'Pishin Valley','Quetta','Sherani','Sibi','Sohbatpur','Washuk','Zhob','Ziarat'
];
$punjab = [
'Ahmed Nager Chatha','Ahmadpur East','Ali Khan Abad','Alipur','Arifwala','Attock','Bhera','Bhalwal','Bahawalnagar',
'Bahawalpur', 'Bhakkar','Burewala','Chillianwala','Chakwal','Chichawatni','Chiniot','Chishtian','Daska','Darya Khan','Dera Ghazi Khan',
'Dhaular','Dina','Dinga','Dipalpur','Faisalabad','Fateh Jang','Ghakhar Mandi','Gojra','Gujranwala','Gujar Khan','Hafizabad',
@javedbaloch4
javedbaloch4 / cities.php
Created June 8, 2020 21:44
PHP Array List Of All Cities of Balochistan
$cities = [
'Awaran','Barkhan','Chagai','Dera Bugti','Gwadar','Harnai','Jafarabad','Jhal Magsi','Kacchi','Kalat','Kech','Kharan','Khuzdar',
'Killa Abdullah','Killa Saifullah','Kohlu','Lasbela','Lehri','Loralai','Mastung','Musakhel','Nasirabad','Nushki','Panjgur',
'Pishin Valley','Quetta','Sherani','Sibi','Sohbatpur','Washuk','Zhob','Ziarat'
];
@javedbaloch4
javedbaloch4 / C++ struct_input_output_using_function
Last active March 5, 2020 17:37
This program, will ask user info using structs and for input using functions.
#include<iostream>
using namespace std;
struct Person {
string name;
int age;
double salary;
};
// ProtoType
@javedbaloch4
javedbaloch4 / index.html
Created July 10, 2019 12:05
HTML CSS Login
<style>
* {margin: 0; padding: 0;}
body {
font-family: calibri;
background: #F3F5F7;
}
#topbar-link {
background: #28abe3;
height: 3px;