So, I have the following toString function:
char* toString(Transaction* transaction){ char transactStr[70]; char id[10]; itoa(transaction -> idTransaction,id, 10); strcat(transactStr, id); strcat(transactStr, "\t"); char date[15]; strftime(date,14,"%d/%m/%Y %H:%M:%S",transaction -> date); strcat(transactStr, date); strcat(transactStr, "\t"); char amount[10]; sprintf(amount,"%g",transaction -> amount); strcat(transactStr,"$ "); strcat(transactStr, amount); return transactStr; }
I think this is a CLION problem that highlights the return line with a warning: The value is outside the local scope (referring to transactStr)
I need to know why this is happening (I'm new to C, btw)
source share