I'm pretty sure i'm the one who's just dumb and don't know my data structures...
None the less, i'm going to post it here for you brilliant guys, so one of you may explain to me why this doesn't work:
#include <iostream>
using namespace std;
double data_convert(int n);
int main(void) {
cout << data_convert(sizeof(int));
}
double data_convert(int n) {
int i;
double x;
x = 8 * n;
for(i = 0; i < 32; i++)
x = x * 32;
return x;
}
I tried using pow from cmath, but I got the same results. Apparently, this outputs "4.67681e+049". Where as it should output (using Windows Calculator) "4294967296".
The for loop is my own hardcoded pow() function for this specific task. All I wanna do is make a program that can show how big a data type is, along with it's range (bit range or something, yeah?)
Thank you.