[Tutorial] Using strcmp without strtok, but more effective
#9

Quote:
Originally Posted by Roko_foko
Посмотреть сообщение
I am using this method because I feel safely while doing it( I know how they work and what are they supposed to do ). Also, when I know how operators work it's easy to find the problem when it occurs. I tried to understand how ZCMD works but didn't succeed. Now, when I use word "work", I don't mean 'how to use it', but how is it scripted/programmed (what actually stands behind 'CMD:'). [...]
Why not read the source code of ZCMD?

You are doing pretty much the same thing that strtok does: skip whitespace and extract a word from a long string. Except strtok is a lot cleaner, as you don't have to worry about string cutting and invent a new processing system for every command. I'm not promoting strtok here, but I'm promoting the usage of functions for similar tasks. If you put the string processing code into a function, you would get strtok.

I support doing things differently, showing that there are other ways, but I would rather use strtok than this. Just my opinion.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)