Skip to content

Instantly share code, notes, and snippets.

Created January 2, 2011 22:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/762904 to your computer and use it in GitHub Desktop.
Save anonymous/762904 to your computer and use it in GitHub Desktop.
#include "stdafx.h"
#include <stdio.h>
#include <stdexcept>
#include <vector>
int _tmain(int argc, _TCHAR* argv[])
{
std::vector<int> arr(1000);
int i = 1;
foo:
printf("%d\n", i);
try
{
arr.at(i) = i;
}
catch (std::out_of_range)
{
return 0;
}
i++;
goto foo;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment