Hello i have a problem with lineing up each column up correctly, the directories seems to be all messed up.

Bellow is my code, a screen shot of the problem is attached to this post.

if(lSwitch == true)
			{
				cout << "\nd: " << setw(15) << right << "" << "  " << iter->filename() << "/" << setw(80) << right << iter->path().parent_path();
				if(recurse_into_subdirs) show_files(*iter, recurse_into_subdirs, lSwitch, rSwitch, aSwitch, regex) ;
			}
			else
			{
				cout << "\n " << setw(15) << right << "  " << iter->filename() << "/" << setw(80) << right << iter->path().parent_path();
				if(recurse_into_subdirs) show_files(*iter, recurse_into_subdirs, lSwitch, rSwitch, aSwitch, regex) ;
			}

I don't understand the meaning of the lSwitch...

Can you check the true length of the filename (with debugging)? It may have unwanted spaces at the end... Did your terminal screen have more than 80+15+other characters for width?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.