Ok, for a lab I have to write the UNIX more filter in C, but I have got everything done execpt one thing. I only hvae it to where it can read 20 lines at a time. But what I want to do is if argv[1] == -Pxx where xx is the amount of lines you want to display at a time. but I need to use a scanf() and a atoi command I think but I have not idea on how to do that. Here is my code and where it sets the amount of line sto be printed is in bold.
could you right a peice of code for me that would do that for me please.
He could, (heck I probably could), but how would you learn anything? Just take his instructions, and implement them the best way that you can think of. Then post that, and see what, if anything, we can suggest.
there's a function to take a substring of a longer string. Find out what it is and how you use it.
Any manual, helpfile or other reference will tell you what to do.
if you work on unix/linux, check the man page for getopt() function. It helps very much. At first it seems like an overhead, but in fact is very usefull.
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.