if we simply pass the address of local variable to a thread function then when that function ends then address of that variable lost(if variable is automatic) and we try to access that address or variable the it doesn’t give correct result .
I’ve resolved this problem by this way:
If i take a local variable pointer and malloc it and then pass it. when we malloc then it falls in heap segment and the it exist for the whole lifetime of program.
Please comment if any issue.