Skip to content
Snippets Groups Projects
Commit e156d5f8 authored by Jake Feddersen's avatar Jake Feddersen
Browse files

Add notes

parent 3327cdd4
No related branches found
No related tags found
No related merge requests found
#include <iostream>
using namespace std;
int main(int argc, char *argv[]) {
// Anything can be thrown as an exception
try {
throw "Error";
} catch (char const *s) {
cout << s << endl;
}
cout << "Hello, World!" << endl;
return 0;
}
File added
Templates:
New version of class created for every type of the class that is used
template <class T>
class someClass { }
Every time another type is used with the template (someClass<int>, someClass<string>, etc, a new copy of the code is created.
Template code must be available where it is used. Unless it is used in
only one file, the entire class is usually written in the header.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment