What code do you have so far? Post it up, even if all it does is handle the command line options.
Type: Posts; User: rabidbadger
What code do you have so far? Post it up, even if all it does is handle the command line options.
The full K&R source is linked to from the page I linked earlier, which is why I -- like tabstop -- am confused about what the OP was after...
A cut 'n' paste from one of these examples might save you some finger time. But it's often easier to learn if you have to type it all yourself ;-)
I suspect that vart is right. Try reading your file using (e.g.) fgetwc() -- which does the legwork for you -- and see if it still looks 'wrong'.
With all respect, '-u' is the only option that POSIX insists that cat supports. You can, of course, choose to program your utility any old way you like, but why are you wanting to repeat the abuse of...
How are you intending to deal with the '-u' option if you're using fgets()...?
I'm sure that you realise your functions largest() and smallest() won't actually print any (valid) values as your main function stands? If you want them to, try passing the value to be printed into...
Erm, that code won't actually do what the OP asked for. It will output up to the line with the search string in, the line with the search string in, the same line with the string replaced, and then...
It's not illegal at all. Look up "Digraphs and trigraphs" on Wikipedia.
It might be blatantly obvious, but after backing up the original I'd run the whole lot through some kind of code formatter/beautifier to get the source into a consistent and readable format (if it...
And if you are a newbie reading through K&R, it might be handy to do so with these extra notes by your side.