void return_path(char* a){
int i=0;
int j=0;
char *d[30];
int cuts=0;
char temp[20];
while(a[i]!='\0')
{
if(a[i]==92)
{
temp[j]='\0';
j=0;
i++;
d[cuts]=temp;// add it to the index and move ahead
this is my code....second funcion works perfectly but the first function is giving me a hard time....it shows all the dir in the path....... in the func return_path() i have declared an arr of pointers and when i get \ it cuts the string,save it in temp and place it into the pointer array...but when i cout the name it is just over writing temp string on all the indexes???? i dnt knw y it is being happening...