After taking break and enjoying weekend now i am out from
Blackout Stage.
One path returns something. One does not. On any reasonable system, you'd be warned about that.
Ok next time i take care of that.
As Nick points out, using the String class is a bad idea. It isn't even close to being necessary in your case, since the read function is using a char array and the output is a larger char array.
Yes, you are right. (Nick, sorry for PM. I really don't know why there is PM option if this is not useful)
Copying the data from one to another using a for loop instead of dynamic memory allocation is going to waste far fewer resources.
Yes, that's why i tried both ways.
Snipped down like this routine is, though, makes your real problem far easier to spot. You have a local variable, strFile, that goes out of scope when the function ends. Yet, you return a pointer to that memory. When the function ends, you've got a pointer to memory that no longer belongs to a function, and is, therefore free to be reused in any amount anywhere. Not a useful thing to have.
Yes, After taking break and enjoy the weekend to recover mysellf from
Blackout Stage i start debugging again and isuue on these lines find as earlier you mention that.
free(buff);
free(pch);
Issue solved and i modify it according to your and holmes4 suggestion.
But this problem open lots of issue front of me i start playing with this platform a month ago (but i am not a bad engineer

). Is there really issue of system crash due String, free(), and malloc. In a post
http://arduino.cc/forum/index.php/topic,115552 mention by executing this sketch system wil crash.
#include <MemoryFree.h>
void setup() {
Serial.begin(9600);
}
void loop() {
int n = 0;
while(n <=100) {
int u = 20*n;
int v = 30*n;
String str = String(n) + ", " + String(u) + ", " + String(v) + [color=red]", " + String(freeMemory());[/color]
Serial.println(str);
delay(500);
n++;
}
Serial.println("Done");
}
result comes in favour of post but if it is modify like that system execute smoothly
#include <SD.h>
void setup() {
Serial.begin(9600);
}
void loop() {
int n = 0;
while(n <=100) {
int u = 20*n;
int v = 30*n;
//int x =
String str = String(n) + ", " + String(u) + ", " + String(v);
str = str + String(n) + ", " + String(u) + ", "; //coment this line and next indicates test 1
str = str + String(n) + ", " + String(u); //coment only this line indicates test 2.
str = str + ", " + String(FreeRam(),DEC); // execute all lines indicate test3
Serial.println(str);
//Serial.println(FreeRam(),DEC);
delay(100);
n++;
}
Serial.println("Done");
}
tests output attached in txt format. Actually i want to say that there is some patterns on which system will crash why?
Is this is due to bug OR our
mistake logically.
NOTE :Spelling and grammer mistake ignore thnx it's your suggestion which makes my playground play-able