Nice tree manipulation and traversing

/*******************************************************
*     MYCPLUS Sample Code - https://www.mycplus.com     *
*                                                     *
*   This code is made available as a service to our   *
*      visitors and is provided strictly for the      *
*               purpose of illustration.              *
*                                                     *
* Please direct all inquiries to saqib at mycplus.com *
*******************************************************/

#include "stdio.h"
#include "dos.h"
#include "dir.h"

char directory_name[128]; //  maximum lenght is 128  as far as i had seen in
     //  win9x, but xp goes upto approx==231. dir length

char *view[] = {
  "????",
  "?",
       /*" ?  ?????",*/
  "   ?????",
  "   ",
  "    ?????"

        };

void TREE_TRAVERSE(char *);
int counter,sw=0;
char current_working_directory[128];

void main()
    {
       clrscr();
       getcwd(current_working_directory,128);// preserve curr. dir..
       chdir("\\");                          //to root , this is important

       TREE_TRAVERSE("*.*");                 // traverl...
       chdir(current_working_directory);     // store to present working directory...
     }




void  TREE_TRAVERSE(char *pointer)
     {
      struct ffblk file;
      int flag,num=0,i,j;
      static int deep_inside = 0;
      flag = findfirst(pointer,&file,FA_DIREC);      // find directory and not filez...

      while(flag == 0)                              // loop until you are out
    {
        if((file.ff_attrib & FA_DIREC ) == FA_DIREC && file.ff_name[0]!='.')
    {
        deep_inside++;      // go into directory...
        directory_name[0] = '\0';

       if(deep_inside == 1)    //if on root put "?"
          strcat(directory_name, view[0]);
       else
    {
    strcat(directory_name, view[1]);     //else decorate
    i=2;
    while(i 0)
    chdir("..");
      }