Int vs long long int

I was having a simple doubt that
if using long long int is slower than int?

1 Like

Yes, but that depends on various factors. One among them is the compiler type. If you are using a 32 bit compiler, integer operations are made in 1 instruction cycle, whereas it takes 2 instruction cycles for long long int operations. If it’s a 64 bit compiler then both the operations are done in 1 instruction cycle. You can refer this earlier post on the same topic.. Even I found this useful, please have a look.

Thanks mate!

1 Like