Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 2:f1d3afaf7e93, committed 2014-08-29
- Comitter:
- triple
- Date:
- Fri Aug 29 08:16:45 2014 +0000
- Parent:
- 1:6be4deab8fdc
- Commit message:
- Correct version of class
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file | 
--- a/main.cpp	Fri Aug 29 08:02:38 2014 +0000
+++ b/main.cpp	Fri Aug 29 08:16:45 2014 +0000
@@ -11,17 +11,17 @@
 USBSerial serial;
 
 int main() {
-    double num1, num2;
+    float num1, num2;
     // Construct an instance of Calculator calc
     Calculator calc(0.0, 0.0);//(number1, number2);
     
     wait(5);
     // Ask user for a number1  
     serial.printf("Enter number1: ");  
-    serial.scanf("%f", num1);   
+    serial.scanf("%f", &num1);   
     // Ask user for a number2 
     serial.printf("Enter numbe2: ");  
-    serial.scanf("\r\n%f", num2);
+    serial.scanf("\r\n%f", &num2);
     
     // Set number1 and number2 to user inputs
     calc.setNumber1(num1);