Skip to content

Instantly share code, notes, and snippets.

Mike Helmick mikehelmick

Block or report user

Report or block mikehelmick

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mikehelmick
mikehelmick / LookAtMemberVariables.cpp
Last active Aug 29, 2015
In our series of how C++ doesn't actually offer you any protection in the language, we show how you can directly access private member variables. Don't try this at home. Ok - do try this at home, and then don't do it at work.
View LookAtMemberVariables.cpp
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
class Point {
public:
void setX(int newX) {
@mikehelmick
mikehelmick / constarray.cpp
Created Feb 13, 2014
Modifying the contents of a const array
View constarray.cpp
#include <iostream>
using namespace std;
void printArray(int a[], int size) {
for (int i = 0; i < size; i++) {
cout << a[i] << " ";
}
cout << endl;
}
@mikehelmick
mikehelmick / Bad.cpp
Created Feb 12, 2014
Another reason I dislike C++ for teaching introductory programming.... this works
View Bad.cpp
#include <iostream>
#include <cstdlib>
class BadActor {
public:
BadActor() {
this->value = 5;
}
int getValue() const {
View bowling.erl
% Bowling scoring calculation in Erlang as a rescursive function
-module(bowling).
-export([score/1]).
% To run - start an erlang shell, erl
%
% c(bowling).
% bowling:score([x, 5, 4, 2, s, x, 0, s, 0, 5, x, 5, s, 6, 2, x, 0, 1]).
You can’t perform that action at this time.