正在加载图片...
Storage class. register restrictions can'tuse scanf/similar functions to read a value directly into a register variable Example /* Faster version of array searching function. * int table search(int a[l, register int n, register int t) register int 1 for(=0;i<n&&a[i]!=t;i++) ;/* search for matching value * return (i!= n)? i:-1 PROGRAMMINGMETHDOLODGY AND SOFTWAREENGINEERING 港城市大 Copyrighto1998 Angus Wu ol Hone KonePROGRAMMING METHDOLODGY AND SOFTWARE ENGINEERING Copyright©1998 Angus Wu Storage Class - register • restrictions • can’t use scanf/similar functions to read a value directly into a register variable Example /* Faster version of array searching function. */ int table_search(int a[], register int n, register int t) { register int i; for (i = 0; i < n && a[i] != t; i++) ; /* search for matching value */ return (i != n) ? i : -1; }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有