Created
March 12, 2015 12:08
-
-
Save khzaw/fbf4696d6a77182fd1a2 to your computer and use it in GitHub Desktop.
This file contains 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
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