I need to get character input from the user and convert it into a float type. However, I can't use arrays, strings or the functions printf() and scanf(). I have to do everything with putchar() and getchar(). How would I do this?
cokaznsyco72
0
Light Poster
Recommended Answers
Jump to Postinitialize a float with value zero.
begin a while loop to take character input, and break on newline entered.
in the body of the while loop you will :
--- check if decimal point is entered. if so, keep track of this fact, and continue to get next character
--- …
All 14 Replies
jephthah
1,888
Posting Maven
cokaznsyco72
0
Light Poster
jephthah
1,888
Posting Maven
DoctorBinary
7
Newbie Poster
jephthah
1,888
Posting Maven
cokaznsyco72
0
Light Poster
DoctorBinary
7
Newbie Poster
DoctorBinary
7
Newbie Poster
jephthah
1,888
Posting Maven
DoctorBinary
7
Newbie Poster
jephthah
1,888
Posting Maven
DoctorBinary
7
Newbie Poster
jephthah
commented:
:)
+7
cokaznsyco72
0
Light Poster
DoctorBinary
7
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.