「C4_Ushiku」の編集履歴(バックアップ)一覧はこちら

C4_Ushiku」(2009/11/22 (日) 12:27:00) の最新版変更点

追加された行は緑色になります。

削除された行は赤色になります。

#comment() &bold(){Exersixe 4-1.}Write the function strrindex(s,t) , which returns the position of the rightmost occurrence of t in s , or -1 if there is none. #highlight(linenumber.c){{ }} &bold(){Exersixe 4-2.}Extend atof to handle scientific notation of the form 123.45e-6 where a floating-point number may be followed by e or E and an optionally signed exponent. #highlight(linenumber.c){{ }} &bold(){Exersixe 4-3.}Given the basic framework, it's straightforward to extend the calculator. Add the modulus ( % ) operator and provisions for negative numbers. #highlight(linenumber.c){{ }} &bold(){Exersixe 4-4.}Add commands to print the top element of the stack without popping, to duplicate it, and to swap the top two elements. Add a command to clear the stack. #highlight(linenumber.c){{ }} &bold(){Exersixe 4-5.}Add access to library functions like sin , exp , and pow . See <math.h> in Appendix B, Section 4. #highlight(linenumber.c){{ }} &bold(){Exersixe 4-6.}Add commands for handling variables. (It's easy to provide twenty-six variables with single-letter names.) Add a variable for the most recently printed value. #highlight(linenumber.c){{ }} &bold(){Exersixe 4-7.}Write a routine ungets(s) that will push back an entire string onto the input. Should ungets know about buf and bufp , or should it just use ungetch ? #highlight(linenumber.c){{ }} &bold(){Exersixe 4-8.}Suppose that there will never be more than one character of pushback. Modify getch and ungetch accordingly. #highlight(linenumber.c){{ }} &bold(){Exersixe 4-9.}Our getch and ungetch do not handle a pushed-back EOF correctly. Decide what their properties ought to be if an EOF is pushed back, then implement your design. #highlight(linenumber.c){{ }} &bold(){Exersixe 4-10.}An alternate organization uses getline to read an entire input line; this makes getch and ungetch unnecessary. Revise the calculator to use this approach. #highlight(linenumber.c){{ }} &bold(){Exersixe 4-11.}Modify getop so that it doesn't need to use ungetch. Hint: use an internal static variable. #highlight(linenumber.c){{ }} &bold(){Exersixe 4-12.}Adapt the ideas of printd to write a recursive version of itoa ; that is, convert an integer into a string by calling a recursive routine. #highlight(linenumber.c){{ }} &bold(){Exersixe 4-13.}Write a recursive version of the function reverse(s) , which reverses the string s in place. #highlight(linenumber.c){{ }} &bold(){Exersixe 4-14.}Define a macro swap(t,x,y) that interchanges two arguments of type t . (Block structure will help.) #highlight(linenumber.c){{ }}

表示オプション

横に並べて表示:
変化行の前後のみ表示: