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.
Diff: main.cpp
- Revision:
- 1:04f4905dd2ae
- Parent:
- 0:68deb959efd5
--- 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;
+}