Apuntadores ejercicio 2

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
AndresGaffS
Date:
Thu Apr 24 01:07:27 2014 +0000
Commit message:
apuntadores ejercicio 2

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 2083a7871209 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Apr 24 01:07:27 2014 +0000
@@ -0,0 +1,23 @@
+#include "mbed.h"
+Serial pc(USBTX, USBRX);
+
+struct numero{
+    float entero;
+    float decimal;
+    }numeros;
+
+void desglosador(float digito, numero *numero2){ // Funcion para desglozar la parte entera de la decimal
+        int variable = digito;
+        numero2 -> entero  = variable;
+        numero2 -> decimal = fmod(digito, numero2 -> entero);
+}
+     
+int main(){
+    float valor = 15.5;    
+    desglosador (valor, &numeros);
+    pc.printf("Entero %f \n",numeros.entero);
+    pc.printf("Decimal %f \n",numeros.decimal);
+    return 0;
+}
+
+   
diff -r 000000000000 -r 2083a7871209 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Apr 24 01:07:27 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/6473597d706e
\ No newline at end of file