Skip to content

Instantly share code, notes, and snippets.

@preslavmihaylov
Created December 10, 2017 17:16
Show Gist options
  • Save preslavmihaylov/f307a6e224e7150d8c1cb311c5cff28f to your computer and use it in GitHub Desktop.
Save preslavmihaylov/f307a6e224e7150d8c1cb311c5cff28f to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
void printError(int errorCode, string msg = "No message")
{
cerr << "Error code: " << errorCode << " (" << msg << ")\n";
}
int main(int argc, char *argv[])
{
printError(9, "Bad alloc");
printError(8);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment