> while ( --argc > 0 && ( *++argv ) [0] == '-' ) > while ( c= *++argv [0] ) > switch (c) {.......} > > I do not understand the portion c = *++argv[0]. From what i understand, > the > 'result' of that incrementing and dereferencing will be c = argv[0][1], > which is wrong. That line increments the argv pointer, dereferences it once, then dereferences it again to compare the byte to '-'. You could replace that while expression with this: while (1) { argc--; if (argc <= 0) break; argv++; if (argv[0][0] != '-') break; > > Shouldn't the line be replaced with c = *++argv[1] ? > FYI, > argv[0] = pointer to array of char "find" > argv[1] = pointer to array of char "-nx" > argv[2] = pointer to array of char "pattern" The source appears to be correct. You should examine the operator precedence rules. They are a pain, but crucial to understanding cryptic code like this. OK, on with the soap box. Bear with me? Please do not write code like this. Parentheses are your friend! Just because some can understand this code does not mean that most programmers will. It took me a bit to understand it, so I know that a fresh graduate is not going to be able to easily maintain code written in this style. Be nice to your co-workers. :-) Brian -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics