Skip to content

Instantly share code, notes, and snippets.

@ereidland
ereidland / gist:5137527
Created March 11, 2013 20:38
Assignment 4 at Library
#include <iostream>
#include <iomanip>
#include <random>
using namespace std;
//See function bodies for comments on these.
int * createArray(int & size);
void findStats(int * arr, int size, int & min, int & max, double & average);
@ereidland
ereidland / gist:5136943
Created March 11, 2013 19:28
Example 3 at Library
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
//Note that in the below example I do not validate the numbers. This is bad practice. Don't do it.
int numStudents,
numScores, //Values can be separated by comma if they have the same base type.
@ereidland
ereidland / gist:5136797
Created March 11, 2013 19:07
Example 2 at Library
#include <iostream>
using namespace std;
#define ARRAY_SIZE 128
void lol(const int); //Function header for lol.
int main()
{
@ereidland
ereidland / gist:5136514
Created March 11, 2013 18:39
Example 1 at Library
#include <iostream>
using namespace std;
void refFunc(int &);//Function headers. They do not require a name or body at this point.
void pointerFunc(int *);
int main()
{
int something = 32; //Declare something as 32.