Enrico Forestieri wrote:
Certainly, you shouldn't use strrchr et al. If the code below can't be made to
work, then there's a heap of useful functions to do what you're trying to
achieve in src/support/filetools.[Ch].

Angus, I am proficient in C not in C++. Please, can you explain why
strrchr and friends are evil in a C++ program? I really want to know,
as it seems to me that in some case C++ adds unnecessary overhead.

It's probably a religous thing ;-)

More seriously, it's a question of maintenance. The C++ code is more readable to C++ programmers. Who tend to be less proficient in C...

Anyway, I reworked your solution and the following works, too.

Good, oh. However, I see that you've discovered two other solutions that would take presendence over this, so I'm actually going to suggest that we just drop your hard work here. Even less code to maintain ;-)

Angus

Reply via email to