
C/C++/VC
hope2jiang
这个作者很懒,什么都没留下…
展开
-
VC and Winsocket Programming - Downloading File From a Website
Using VC Develop a Tool to Download File1、介绍和背景昨天决定写一个程序“批量下载网页上相同格式的文件”,本以为用VC会很轻松搞定,但一用才知道,WinSocket编程几乎忘光了,弄了几乎整个下午加半个晚上都还徘徊在起点上,唉,又犯了眼高手低的错误。所以呢,我想应该把“批量下载网页上相同格式的文件”分成几个部分,或说是步骤,一步步来吧。现在就让我们来原创 2006-02-03 23:38:00 · 2256 阅读 · 0 评论 -
Selected solutions to exercise of "The C Programming Language" 2e (Part 2)
Exercise 1-13Write a program to print a histogram of the lengths of words in its input. It is easy to draw the histogram with the bars horizontal; a vertical orientation is more challenging.Horizo原创 2006-02-19 16:38:00 · 1216 阅读 · 0 评论 -
Chapter 4– Functions and Program Structure of TCPL (Part 11)
Exercise 4-8Suppose that there will never be more than one character of pushback. Modify getch and ungetch accordingly./* K&R Exercise 4-8 *//* written by Steven Huangrevised by ffffx0@gma原创 2006-02-21 18:38:00 · 1894 阅读 · 0 评论 -
Chapter 3– Control Flow of TCPL (Part 9)
Chapter 3 – Control FlowExercise 3-1Our binary search makes two tests inside the loop, when one would suffice (at the price of more tests outside). Write a version with only one test inside the lo原创 2006-02-20 23:46:00 · 2045 阅读 · 0 评论 -
Selected solutions to exercise of "The C Programming Language" 2e (Part 7, End of Chapter 1)
Exercise 1-23Write a program to remove all comments from a C program. Dont forget to handle quoted strings and character constants properly. C comments do not nest. Solution by othershttp://u原创 2006-02-19 23:21:00 · 1559 阅读 · 0 评论 -
Selected solutions to exercise of "The C Programming Language" 2e (Part 1)
Exercise 1-8Write a program to count blanks, tabs, and newlines.#include int main(void){ int blanks, tabs, newlines; int c; int done = 0; int lastchar = 0;原创 2006-02-19 16:35:00 · 1248 阅读 · 0 评论 -
Chapter 4– Functions and Program Structure of TCPL (Part 10)
Chapter 4 – Functions and Program StructureExercise 4-1Write the function strrindex(s,t) , which returns the position of the rightmost occurrence of t in s , or -1 if there is none.#include原创 2006-02-21 18:28:00 · 2091 阅读 · 0 评论 -
Chapter 2 – Types, Operators and Expressions of TCPL
Chapter 2 – Types, Operators and ExpressionsExercise 2-1Write a program to determine the ranges of char, short, int, and long variables, both signed and unsigned, by printing appropriate values fr原创 2006-02-20 21:53:00 · 2393 阅读 · 0 评论 -
Selected solutions to exercise of "The C Programming Language" 2e (Part 6)
Exercise 1-22Write a program to "fold" long input lines into two or more shorter lines after the last non-blank character that occurs before the n -th column of input. Make sure your program does so原创 2006-02-19 23:16:00 · 1632 阅读 · 0 评论 -
Selected solutions to exercise of "The C Programming Language" 2e (Part 5)
Exercise 1-20Write a program detab that replaces tabs in the input with the proper number of blanks to space to the next tab stop. Assume a fixed set of tab stops, say every n columns. Should n be a原创 2006-02-19 18:22:00 · 1528 阅读 · 0 评论 -
Selected solutions to exercise of "The C Programming Language" 2e (Part 4)
Exercise 1-18Write a program to remove all trailing blanks and tabs from each line of input, and to delete entirely blank lines./* K&R2 1-18 p31: Write a program to remove trailing blanks and t原创 2006-02-19 17:41:00 · 1729 阅读 · 0 评论 -
Selected solutions to exercise of "The C Programming Language" 2e (Part 3)
Exercise 1-16Revise the main routine of the longest-line program so it will correctly print the length of arbitrarily long input lines, and as much as possible of the text. /* I do not think t原创 2006-02-19 16:42:00 · 1218 阅读 · 0 评论