Visualize a tree: Difference between revisions

Content added Content deleted
m (in the code)
Line 70: Line 70:


typedef struct stem_t *stem;
typedef struct stem_t *stem;
struct stem_t { char *str; stem next; };
struct stem_t { const char *str; stem next; };


void tree(int root, stem head)
void tree(int root, stem head)
{
{
static char *sdown = " |", *slast = " `", *snone = " ";
static const char *sdown = " |", *slast = " `", *snone = " ";
struct stem_t col = {0, 0}, *tail;
struct stem_t col = {0, 0}, *tail;