Project Euler #8 in C++: greatest product of k consecutive digits
Extra multiplication


    unsigned long long product=1;
    for (int j=start;j&lt;end;j++){
        product*=ctoi(number[j]);
    }



You can do one less multiplication.  

    unsigned long long product = ctoi(number[j]);
    for (int j = start + 1; j &lt; end; j++) {
        product *= ctoi(number[j]);
    }


Obviously this would fail if K were less than 1, but that's outside the problem scope.  

ctoi is not a free operation

You also perform ctoi at least K times for each digit.  You could do this just once with something like 

    std::vector&lt;int&gt; digits;
    for (char c : number) {
        digits.push_back((int)(c - '0');
    }


Then operate on digits rather than number.  

Benchmark optimizations


            if (ctoi(number[l-K])!=0){
                product=(product/ctoi(number[l-K]))*ctoi(number[l]);
            }else{
                product=prodK(number,l-K+1,l+1);
            }



In theory, this saves K-1 multiplications at the cost of doing a multiplication, a division, and a comparison/branch.  But don't forget that it adds a comparison/branch to every iteration.  You might find that is cheaper to always do the K-1 multiplications.  

Benchmark it both ways with a variety of inputs to see.  

Don't waste math

You have 


    for (int j=start;j&lt;end;j++){



and 


                    product=prodK(number,l-K+1,l+1);



But you could just have 


    for (int j = start; j &lt;= end; j++){



and 

                    product = prodK(number, l-K+1, l);


That saves you an addition.  Might not be worth much, but it also might be better than nothing.  

Assignments can be expensive


            max=(product&gt;max)?product:max;



This will produce the correct answer, but it does an assignment every time.  You don't need to do the no-op assignment.  Benchmark against 

            if (product &gt; max) {
                max = product;
            }


That's more code, but it's faster unless the compiler already optimizes out the no-op assignment.  Probably not a lot faster, as this is a comparatively simple assignment.  

Simplify compare


    for (int i=0;i&lt;T;i++){



i&lt;T is often implemented as i - T &lt; 0.  But do you need to do the i - T?

Since you never use T for anything other than this loop, you could say 

    for (; T &gt; 0; T--) {


That saves having an i variable at all, and now you compare T to 0 directly.  

Benchmark

These are suggestions that assume that the compiler is operating in a certain way.  If I'm wrong about that, then some of these suggestions may be counterproductive.  Note that the compiler may have similar or better optimizations that it is already doing.  You benchmark to confirm (or refute) such assumptions.