10:48 What is wrong with this program? 1) You can't use argv[n] as a path - this is not portable and will never work on Windows; 2) You can't portably print path or argv[n] to std::cout; 3) Your program prints nothing - you didn't flush (although ... could, theoritically); 4) Your program will crash if, for example, there is no permission to traverse the directory; 5) Having your includes not sorted is gross; 6) Two TOCTOU bugs.
nice
10:48 What is wrong with this program? 1) You can't use argv[n] as a path - this is not portable and will never work on Windows; 2) You can't portably print path or argv[n] to std::cout; 3) Your program prints nothing - you didn't flush (although ... could, theoritically); 4) Your program will crash if, for example, there is no permission to traverse the directory; 5) Having your includes not sorted is gross; 6) Two TOCTOU bugs.