正在加载图片...
Motivation Initially code was reusable by encapsulating it within functions Example Write void swap (int& firstr int& second) int temp= firsti first second second =temp; Then call swap(x,y); COMP 152Motivation ▪ Initially code was reusable by encapsulating it within functions ▪ Example: • Write • Then call swap(x,y); COMP152 4 void swap (int& first, int& second) { int temp = first; first = second; second = temp; }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有