This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Function_Pointers.cpp : This file contains the 'main' function. Program execution begins and ends there. | |
// | |
#include "pch.h" | |
#include <iostream> | |
#include <string> | |
using namespace std; | |
int add() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "pch.h" | |
#include <iostream> | |
#include <string> | |
using namespace std; | |
//Parent Class | |
class Animal | |
{ | |
public: | |
string name; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "pch.h" | |
#include <iostream> | |
#include <string> | |
using namespace std; | |
//Parent Class | |
class Animal | |
{ | |
public: | |
string name; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
using namespace std; | |
class Fighters { | |
public: | |
string model; | |
int Health; | |
int Strength; | |
void add_stealth(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
using namespace std; | |
enum Animals { Bear, Cat, Chicken }; | |
//enum Birds { Eagle, Duck, Chicken }; // error! Chicken has already been declared! | |
enum class Fruits { Apple, Pear, Orange }; | |
enum class Colours { Blue, White, Orange }; // no problem! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from math import * | |
import struct | |
''' | |
This is | |
Multi | |
Line | |
comment | |
''' | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
food_cook_dict = { | |
"pasta" : "Aaron", | |
"bread" : "Thomas", | |
"rice" : "John", | |
"Soup" : "Kate", | |
"noodles" : "Liam", | |
} | |
# dictionary are unordered unlike lists till python 3.6 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#try to write a simple hex dump | |
import binascii,struct | |
fd = open("abcd.exe", "r") | |
fd_contents_str = fd.read() | |
fd_contents_hex = (binascii.b2a_hex(fd_contents_str)).upper() | |
Hex_dump = [] | |
Byte_str = "" | |
for i, Half_byte in enumerate(fd_contents_hex): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int LocateProcess(wchar_t* proc) | |
{ | |
// Need to add #include <tlhelp32.h> for PROCESS* definitions | |
HANDLE hProcessSnap; | |
HANDLE hProcess; | |
PROCESSENTRY32 pe32; | |
DWORD dwPriorityClass; | |
int FoundPID; | |
// Take a snapshot of all processes in the system. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int LocateProcess(wchar_t* proc) | |
{ | |
// Need to add #include <tlhelp32.h> for PROCESS* definitions | |
HANDLE hProcessSnap; | |
HANDLE hProcess; | |
PROCESSENTRY32 pe32; | |
DWORD dwPriorityClass; | |
int FoundPID; | |
// Take a snapshot of all processes in the system. |