i can't make a substring in c++ with weird error : i am trying to make a simple program that print a character and you should press it quickly to win and train to type quickly
with a runtime error "Unhandled exception at 0x772A33D2 in Learn To Type Quickly.exe: Microsoft C++ exception: std::out_of_range at memory location 0x00FEF138. occurred"

```
#include <iostream>
#include <ctime>
#include <cstdlib>
#include <string.h>
using namespace std;
int main()
{
	srand((unsigned)time(NULL));
	while (true)
	{
		int r = rand() % 26;
		string length = "abcdefghijklmnopqrstuvwxyz";
		size_t found = r;
		size_t sz = 1;
		string sub = length.substr(length.at(found),sz);
		cout << sub << endl;
	}
}
```

Unhandled exception at 0x772A33D2 in Learn To Type Quickly.exe: Microsoft C++ exception: std::out_of_range at memory location 0x00FEF138. occurred