Skip to content

Instantly share code, notes, and snippets.

#include <iostream>
using namespace std;
template <class E>
class LinkedList
{
struct Node;
Node* first;
#define _USE_MATH_DEFINES
#define L_TO_CU_FT 28.32
#include <iostream>
#include <math.h>
#include <sstream>
using namespace std;
void getDimensions(double&, double&);
@svenoaks
svenoaks / gist:8514257
Created January 20, 2014 03:06
Passing an object with pointers by value
#include <iostream>
#include <string>
using namespace std;
class passed
{
char *str;
int length = 100; //value of length can be determined at run-time
int *dyn = new int[length]; //new int[length] returns a pointer to
//first element of the array.
cout << "Using pointers:" << endl;
*dyn = 10; //dyn[0] and *dyn are equivalent!
*(dyn + 1) = 15; // *(dyn + 1) and dyn[1] are equivalent!