Skip to content

Instantly share code, notes, and snippets.

@khzaw
Created March 12, 2015 12:08
Show Gist options
  • Save khzaw/fbf4696d6a77182fd1a2 to your computer and use it in GitHub Desktop.
Save khzaw/fbf4696d6a77182fd1a2 to your computer and use it in GitHub Desktop.
double sqrt(double); // the square root function takes a double
class Vector {
public:
Vector(int s);
double& operator[](int i);
int size();
private:
double* elem; // elem points to an array of sz doubles
int sz;
};
Vector::Vector(int s) : elem {new double[s]}, sz{s}
{}
d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment