int array to long
Hi, i have int array and i need to convert it to long int. Example array:
1 2
|
int asd[]={2,0,0,9};
long int l;
|
how can i make l==2009? Don't forget that asd[] values can be changed at runtime.
Thanks for any help because i have no idea how to do this.
Give to each asd value the right 10 power and add it to 'l'
l = asd[0]*1000 + asd[1]*100 + asd[2]*10 + asd[3];
Thanks Bazzy!
Topic archived. No new replies allowed.