Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
I want to print my data from typedef struct, the code is like this:
typedef struct _my_data{ int data1 float data2 char data3 }MY_DATA; MY_DATA data; #define DATA_SIZE 7 void print_data(){ char *Prnt = (char *)data, i; data.data1 = 235; data.data2 = 3.12; data.data3 = 11; pc.putc(0xFF); pc.putc(0xFF); for(i=0;i<DATA_SIZE;i++) pc.putc(*Prnt++); pc.putc(0x0D); }It works on my AVR but in mbed compiler it is error.
"No suitable conversion function from "MY_DATA" to "char *" exists (E413)" in file "/Test/print.h"
Can anyone tell me how to overcome this problem???
Thank you,
Agie