I have try alot of thing to make it work
but I see it make a char as array but when I add a other char = the out I do not got the same data out
if anyone can help or point me in the right area
char dataout;
- void read_file_now(char *name, char *output) {
- char oldData[64];
- FILE* f = fopen(name, "r");
- if (f == NULL) {
- ESP_LOGE(TAG, "Failed to open file for reading");
- return;
- }
- int i = 0;
- do{
- char cx = fgetc(f);
- if (feof(f)){
- break;
- }
- oldData[i] = cx;
- i++;
- ESP_LOGE(TAG, "%c", cx);
- } while (1);
- printf("Final Data: %s\n", oldData);
- dataout = oldData;
- fclose(f);
- return;
- ESP_LOGE(TAG, "We readed file %s", dataout );
Thank you all