I'm having trouble figuring what's missing in the code in order to convert to IEEE754 representation. when i did the input it said enter a number for IEEE754 representation and it never converted it. What's missing?
What I have tried:
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string>
#include <iostream>
#include <cmath>
#include <math.h>
using namespace std;
float getUserInput();
int wtb(int whole, int w[]);
void ftb(int fraction,int sizew,int f[]);
void etb(int e[], int exponent, int size);
void move(int e[],int w[], int f[], int s[]);
void display(int s[]);
int main()
{
int opt getuserOption();
int opt;
int IEEE754;
switch(opt){
case 1:IEEE754();
break;
}
int str;
cout ;str.at0;
int s[32];
int const SIZE = 22;
int w[SIZE]={2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2};
int sw = 0;
int f[SIZE-sw];
int number;
float whole = truncf(number);
float fraction = 0;
int sizew = wtb(whole,w);
ftb(fraction,sizew,f);
int size = 8;
int e[size];
int exponent = 0;
etb(e,exponent,size);
move(e,w,f,s);
display(s);
return 0;
}
float getUserInput(){
float number;
int getuserOption;
int opt;
cout << "Please enter a number to convert to IEEE754: " << " ";
cout << "1 Convert number to IEEE754" << endl;
cout << "2 Convert IEEE754 to number" << endl;
cout << "3 Exit" << endl;
cin >> opt;
cin >> number;
return opt;
return number;
}
int wtb(int whole, int w[]){
int sizew = 0;
return sizew;
}
void ftb(int fraction,int sizew,int f[]){
}
void etb(int e[], int exponent, int size){
}
void move(int e[],int w[], int f[], int s[]){
}
void display(int s[]){
}