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 1:04f4905dd2ae, committed 2015-03-13
- Comitter:
- tony63
- Date:
- Fri Mar 13 15:33:03 2015 +0000
- Parent:
- 0:68deb959efd5
- Commit message:
- este es un ejemplo del viernes 13
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Fri Mar 21 16:28:01 2014 +0000
+++ b/main.cpp Fri Mar 13 15:33:03 2015 +0000
@@ -1,12 +1,18 @@
#include "mbed.h"
-
-DigitalOut myled(LED2);
-
-int main() {
- while(1) {
- myled = 1;
- wait(0.1);
- myled = 0;
- wait(0.1);
- }
+
+// Function which takes a pointer to a char* buffer.
+void BufferRead(char* pBuffer)
+{
+ * pBuffer = 'h';
}
+
+int main()
+{
+ void* pvBuffer = malloc(42);
+
+ // Calling BufferRead with a void* pointer instead of a char* pointer.
+ BufferRead((char*)pvBuffer);
+ //BufferRead(pvBuffer); // *** This is the line which generates the error. ***
+
+ return 0;
+}