Prime generator from one to n
The algorithm looks good overall. Here are a few comments :



using namespace std; is sometimes frowned upon : some might say that putting it in a cpp file (by opposition to a header file) is ok, some might say that it's not. In any case, it is worth having a read at the link.



#define printprimes() //for each(bool b in primes) cout &lt;&lt; b &lt;&lt; endl;


does not seem really useful.



If you want to handle wrong input in a better way you could have a look at the other ways to convert arrays of char to number.



bool skipprint = false;

if(argc &gt;=3) if(!strcmp(argv[2], "noprint")) skipprint = true;


can become :

bool skipprint = false;
if(argc &gt;=3 &amp;&amp; !strcmp(argv[2], "noprint")) skipprint = true;


which is nothing but :

bool skipprint = (argc &gt;=3 &amp;&amp; !strcmp(argv[2], "noprint"));


Also it might be even better to do :

bool print = (argc &lt; 3 || strcmp(argv[2], "noprint"));




    if(!primes[l]) {
        //cout &lt;&lt; l &lt;&lt; " is false" &lt;&lt; endl;
        continue;
    }
    for(unsigned long long cl = 2*l; cl &lt; numt; cl+= l) {
        //cout &lt;&lt; cl &lt;&lt; ", a multiple of " &lt;&lt; l &lt;&lt; endl;
        primes[cl] = false;
    }


can be written :

    if(primes[l]) {
        for(unsigned long long cl = 2*l; cl &lt; numt; cl+= l) {
            //cout &lt;&lt; cl &lt;&lt; ", a multiple of " &lt;&lt; l &lt;&lt; endl;
            primes[cl] = false;
        }
    }




In for(unsigned long long l = 0; l&lt;=sqrtt; l++), you can start from index 2. Please note that if you forget to initialise prime[0] to false, you'll get stuck in an infinite loop.



In for(unsigned long long cl = 2*l; cl &lt; numt; cl+= l), you can start at index l*l because any i*l with i &lt; l should have been crossed out already.



if(!skipprint) for(unsigned long long l = 0; l&lt;numt; l++) if(primes[l]) {
    cout &lt;&lt; l &lt;&lt; endl;
    count ++;
}
if(skipprint) for(unsigned long long l = 0; l&lt;numt; l++) if(primes[l]) count ++;


could be rewritten in many different ways. Most obvious one is to use an else :

if (skipprint) for(unsigned long long l = 0; l&lt;numt; l++) if(primes[l]) count ++;
else for(unsigned long long l = 0; l&lt;numt; l++) if(primes[l]) {
    cout &lt;&lt; l &lt;&lt; endl;
    count ++;
}


A probably better option in order not to repeat code is to do :

for(unsigned long long l = 0; l&lt;numt; l++) if(primes[l]) {
    if (!skipprint)
        cout &lt;&lt; l &lt;&lt; endl;
    count ++;
}




Also, you should probably write your algorithm in a function on its own. Other optimisation can be analysed like removing all even numbers from the beginning to use a smaller container.