I have the following struct in the header file:
static FILINFO fno;
Which looks like so:
typedef struct {
DWORD fsize; /* File size */
WORD fdate; /* Last modified date */
WORD ftime; /* Last modified time */
BYTE fattrib; /* Attribute */
char fname[13]; /* File name */
} FILINFO;
Now I would like a certain function to return a pointer to fname[] which should be possible since the struct is defined static. Here is my function:
char* get_open_file_name (void)
{
return fno.fname;
}
I'm calling this function from main like so:
char* temp;
int main (void)
{
intialize_sd_card ();
...
...
temp = get_open_file_name();
This results in conflicting types error message. However if I try to call it like so:
char* temp = get_open_file_name();
It works. What am I missing here?
EDIT: Here is the actual error msg I'm getting from GCC
Severity Code Description Project File Line
Warning assignment makes integer from pointer without a cast