function returns address of local variabe
const char * read() {
FILE *fp;
char buff[256];
fp = fopen("/sys/class/net/enp1s0/statistics/rx_bytes", "r");
fgets(buff, 256, (FILE*)fp);
fclose(fp);
return buff;
}
int main(){
const char* server_message = read(); //returns null here
}
The question is: how to assign the buuf's value to server_message variable
Thanks