Hi again, first; i realise this peace of code is stupid, it has been taken out of context, altered for the sake of simplicity etc.
I wonder if the problem is the quite large number stored in int to (changed to unsigned long int)
i have read on cplusplus.com that even a signed int should be enough though? (i think?) but i believe this varies from compiler to compiler (or is it just from system to system?)
here goes.
#include <iostream>
using namespace std;
int udregn (int tal);
int main()
{
unsigned long int to=2;
for (int i=0;i<64;i=i+1) {
to = to*2;
cout<< to <<endl;
}
cout<< to <<"hej";
return 0;
}
the output is just increasing numbers until 2147483648 and from there on it's just zeros?