I quickly wrote a primes program that uses the seive of eratosthenes. I get an appcrash when I run the program. I debugged it and it told me `std::bad_alloc`. The debugger will not tell me which line of my code the exception occured on but tells me which line of system code. My source is as follows. I am somewhat new to c++.

```
#include <iostream>
#include <vector>
#include <string>
#include <math.h>

using namespace std;

int main(int argc, char* argv[])
{
    unsigned long long numt;
    if(argc < 2) {
        cout << "Usage: "<<argv[0]<<" <primes until...>" << endl;
        return 1;
    }

    else if(atol(argv[1])) {
        cout << "Usage: "<<argv[0]<<" <primes until...>" << endl;
        return 1;
    }
    numt = atol(argv[1]);
    vector<bool> primes(numt);

    for each(bool b in primes) b = true;

    primes[0] = false;

    long double sqrtt = sqrt(numt);
    for(unsigned long long l = 0; l<=sqrtt; l++) {
        if(!primes[l]) continue;
        for(unsigned long long cl = l; cl < numt; cl+= l) primes[cl] = false;
    }

    for(unsigned long long l = 0; l<numt; l++) if(primes[l]) cout << l;

    return 0;
}

```

Please also inform me of any bad programming practices too, please.