I am having a structure:
struct K
{
char a[10];
char b[10];
};
I wish to convert this structure to a char* pointer and print the value on Uart. Uart takes char* pointer as input.
My main function looks like:
void main()
{
struct K x= { "Hello","Pollo"};
struct K *revert;
char *buffer;
buffer = (char *)&x;
revert = (struct K *) buffer;
printf("%s %s", revert->a,revert->b);
}
Note: printf() won't work, I am using a UART.
I want to print the buffer value on UART when it is done with converting structure pointer to char *
pointer. Is it possible to do that?