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 <cstdlib> | |
#include <cstring> | |
#include <ctime> | |
#include <iostream> | |
#include <fstream> | |
using namespace std; | |
template<typename T> | |
class Deck | |
{ |
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
-- DO NOT ALTER THIS FILE. IF YOU DO, AUSTRALIA WILL BE SWALLOWED UP BY A | |
-- VOLCANO, AND YOU WILL HAVE BAD KARMA FOR LIFE. OH, AND THE GAME WILL BREAK. | |
arg = nil | |
debug.debug = nil | |
debug.getfenv = getfenv | |
debug.getregistry = nil | |
dofile = nil | |
io = { write = wcLog } | |
loadfile = nil |
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> | |
using namespace std; | |
bool isPalindrome(const char* inText) | |
{ | |
if (!inText || !*inText) | |
return false; // Empty strings fail. OK? | |
const char* a = inText - 1; | |
const char* b = inText; |
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> | |
using namespace std; | |
class LoudMouth | |
{ | |
public: | |
LoudMouth(int inName) : mName(inName) | |
{ | |
cout << "constructed " << mName << " at " << (void*)this << endl; | |
} |
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 main(int argc, char** argv) | |
{ | |
int stuff[] = { 1, 2, 3, 4, 5 }; | |
int (*p)[5] = &stuff; | |
return 0; | |
} |
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
#ifndef MEMORYPOOL_HPP | |
#define MEMORYPOOL_HPP | |
#include <cstdlib> | |
#define SliceCount 64 | |
class MemoryPool | |
{ | |
public: |
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
.file "fun.cpp" | |
.section .rodata | |
.LC0: | |
.string "HERRO" | |
.text | |
.globl main | |
.type main, @function | |
main: | |
.LFB4: | |
.cfi_startproc |
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
import Core; // Bring in standard library. | |
export Sample; // Set the namespace/package for the code in this file. | |
class Rational | |
{ | |
// Like C#, constant values are inherently 'static'. | |
public constant int32 MinDenominator = 1; | |
// Class member variables are always all private. | |
int32 _numerator = 0; |
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
import Core; | |
export Samples.Polygon; | |
// The keyword 'base' allows inheritance. | |
// It automagically marks the destructor as 'virtual'. | |
base class Polygon | |
{ | |
int32 _edgeCount; |
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 "GameServer.hpp" | |
#include <QDataStream> | |
#include <QDebug> | |
GameServer::GameServer(QObject* parent) : QObject(parent) | |
{ | |
_server = new QTcpServer(this); | |
connect(_server, SIGNAL(newConnection()), SLOT(onConnect())); | |
if (_server->listen(QHostAddress::Any, 8080)) |
OlderNewer