JSTL ʹÓà c:forEach
ÔÚ Web Ó¦ÓóÌÐò»·¾³ÖУ¬µü´úÖ÷ÒªÓÃÓڷôæºÍÏÔʾÊý¾Ý¼¯£¬Í¨³£ÊÇÒÔÁбí»ò±íÖеÄһϵÁÐÐеÄÐÎʽÏÔʾ¡£ÊµÏÖµü´úÄÚÈݵÄÖ÷Òª JSTL ²Ù×÷ÊÇ <c:forEach>; ¶¨ÖƱê¼Ç¡£¸Ã±ê¼ÇÖ§³ÖÁ½ÖÖ²»Í¬ÑùʽµÄµü´ú£ºÕûÊý·¶Î§Éϵĵü´ú£¨ÀàËÆ Java ÓïÑ﵀ for Óï¾ä£©ºÍ¼¯ºÏÉϵĵü´ú£¨ÀàËÆ Java ÓïÑ﵀ Iterator ºÍ Enumeration Àࣩ¡£
½øÐÐÕûÊý·¶Î§µü´úÓõ½ÁËÇåµ¥ 1 ÖÐËùʾµÄ <c:forEach>; ±ê¼ÇµÄÓï·¨¡£begin ºÍ end ÊôÐÔҪôÊǾ²Ì¬ÕûÊýÖµ£¬ÒªÃ´ÊÇ¿ÉÒԵóöÕûÊýÖµµÄ±í´ïʽ¡£ËüÃÇ·Ö±ðÖ¸¶¨µü´úË÷ÒýµÄ³õʼֵÒÔ¼°µü´úË÷ÒýµÄÖÕÖ¹Öµ¡£µ±Ê¹Óà <c:forEach>; ÔÚÕûÊý·¶Î§ÄÚ½øÐеü´úʱ£¬ÕâÁ½¸öÊôÐÔÊDZØÐèµÄ£¬¶øÆäËüËùÓÐÊôÐÔ¶¼ÊÇ¿ÉÑ¡µÄ¡£
Çåµ¥ 1. ͨ¹ý <c:forEach>; ²Ù×÷½øÐÐÊý×Öµü´úµÄÓï·¨
<c:forEach var="name" varStatus="name"
begin="expression" end="expression" step="expression">;
body content
</c:forEach>;
µ±³öÏÖ step ʱ£¬ËüÒ²±ØÐëÊÇÕûÊýÖµ¡£ËüÖ¸¶¨Ã¿´Îµü´úºóË÷ÒýµÄÔöÁ¿¡£ÕâÑù£¬µü´úË÷Òý´Ó begin ÊôÐÔµÄÖµ¿ªÊ¼£¬ÒÔ step ÊôÐÔµÄֵΪÔöÁ¿½øÐеÝÔö£¬ÔÚµü´úË÷Òý³¬¹ý end ÊôÐÔµÄֵʱֹͣµü´ú¡£×¢£ºÈç¹ûÊ¡ÂÔÁË step ÊôÐÔ£¬ÄÇô²½³¤È±Ê¡Îª 1¡£
Èç¹ûÖ¸¶¨ÁË var ÊôÐÔ£¬ÄÇô½«»á´´½¨Ò»¸ö´øÓÐÖ¸¶¨Ãû³ÆµÄ²¢ÏÞ¶¨ÁË×÷ÓÃÓòµÄ±äÁ¿£¬²¢½«Ã¿´Îµü´úµÄµ±Ç°Ë÷ÒýÖµ¸³¸ø¸Ã±äÁ¿¡£ÕâÒ»ÏÞ¶¨ÁË×÷ÓÃÓòµÄ±äÁ¿¾ßÓÐǶÌ×ʽ¿ÉÊÓÐÔ — Ö»¿ÉÒÔÔÚ <c:forEach>; ±ê¼ÇÌåÄÚ¶ÔÆä½øÐзÃÎÊ¡££¨ÎÒÃǺܿ콫ÌÖÂÛ¿ÉÑ¡ÊôÐÔ varStatus µÄÓ÷¨¡££©Çåµ¥ 2 ÏÔʾÁ˶ÔÒ»×é¹Ì¶¨ÕûÊýÖµ½øÐеü´úµÄ <c:forEach>; ²Ù×÷ʾÀý¡£
Çåµ¥ 2. ʹÓà <c:forEach>; ±ê¼ÇÀ´Éú³É±íÁÐÊý¾Ý£¬ÕâЩÊý¾Ý¶ÔÓ¦ÓÚijһ·¶Î§ÄÚµÄÊýÖµ¡£
<table>;
<tr>;<th>;Value</th>;
<th>;Square</th>;</tr>;
<c:forEach var="x" begin="0" end="10" step="2">;
<tr>;<td>;<c:out value="${x}"/>;</td>;
<td>;<c:out value="${x * x}"/>;</td>;</tr>;
</c:forEach>;
</table>;
Èçͼ 3 ÖÐËùʾ£¬ÉÏÃæµÄʾÀý´úÂëÉú³ÉÁËÒ»ÕÅ±í£¬ÏÔʾǰÎå¸öżÊý¼°Æäƽ·½¡£ÕâÊÇͨ¹ý½« begin ºÍ step ÊôÐÔÖµÖ¸¶¨Îª 2£¬¶ø½« end ÊôÐÔÖµÖ¸¶¨Îª 10 ʵÏֵġ£´ËÍ⣬Óà var ÊôÐÔ´´½¨ÓÃÓÚ´
Ïà¹ØÎĵµ£º
ÍøÉÏÒ»µÀ½ðɽµÄÃæÊÔÌ⣺
http://topic.csdn.net/u/20100524/14/0eff992a-2849-4db6-bdaa-d4a200e79b7c.html
Çë·Ö±ðÓÃC++µÄÃæÏò¶ÔÏóºÍ·ºÐÍ»úÖÆ£¬±àдʵÏÖTemplate MethodģʽµÄʾÀý´úÂ룬²¢±È½ÏÁ½ÖÖ·½Ê½¸÷×ÔµÄÓÅȱµã¡£
ÓÃÐ麯ÊýʵÏÖTemplate MethodµÄ·½Ê½¾Í²»¶à˵ÁË¡£Ó÷ºÐ͵ķ½Ê½ÊµÏÖ¶à̬ÔÚATLÀïÃæÓдóÁ¿µÄÓõ½£¡
·ºÐ͵ ......
ÔÚ´Ëժ¼C±àÒëʱ³öÏֵľ¯¸æÐÅÏ¢µÄÒâÒå¡£
1) warning: ISO C90 forbids mixed declarations and code
CÓïÑÔÊÇÃæÏò¹ý³ÌµÄÓïÑÔ£¬Õâ¸ö¾¯¸æͨ³£±íʾÉùÃ÷Ó¦¸ÃÔÚÆäËû´úÂëµÄÇ°Ãæ¡£
2) warning: initialization from incompatible pointer type
ÔÚLinux kernelÖÐÓÐÐí¶àcallbackº¯Êý£¬Õâ¸ö¾¯¸æ±íÃ÷callbackº¯ÊýµÄʵÏÖÖУ¬»òÕß·µ ......
extern "C"
extern "C"°üº¬Ë«Öغ¬Ò壬ÆäÒ»£º±»ËüÐÞÊεÄÄ¿±êÊÇ“extern”µÄ£»Æä¶þ£º±»ËüÐÞÊεÄÄ¿±êÊÇ“C”µÄ¡£
1£©±»extern “C”ÏÞ¶¨µÄº¯Êý»ò±äÁ¿ÊÇexternÀàÐ͵ģ»
externÊÇC/C++ÓïÑÔÖбíÃ÷º¯ÊýºÍÈ«¾Ö±äÁ¿×÷Ó÷¶Î§£¨¿É¼ûÐÔ£©µÄ¹Ø¼ü×Ö£¬¸Ã¹Ø¼ü×Ö¸æËß±àÒëÆ÷£¬ÆäÉùÃ÷µÄº¯ ......
Îļþº¯Êý´ò¿ªÎļþº¯Êý
[º¯ÊýÍ·]
FILE *fopen£¨char *filename, Char *mode£©
[²ÎÊý]
filename ×Ö·ûÐÍÖ¸Õ룬ָÏòµÄ×Ö·û´®ÊÇÒª´ò¿ªµÄ´ÅÅÌÎļþÃû£»mode ×Ö·ûÐÍÖ¸Õ룬ָÏòµÄ×Ö·û´®ÊÇÎļþʹÓ÷½Ê½¡£ÕâÁ½¸ö²ÎÊý¶ÔÓ¦µÄʵ²Î¿ÉÒÔÊÇ×Ö·ûÖг£Á¿£¬Ò²¿ÉÒÔÊDz¹·ûÊý×éÊ×µØÖ·£¬»òÕßÊÇÖ¸Ïò×Ö·û´®µÄÖ¸Õë±äÁ¿¡£
ÎļþʹÓ÷½Ê½¿ ......
ANSI C±ê×¼ÖÐÓм¸¸ö±ê×¼Ô¤¶¨Òåºê£º__FILE__ __DATE__ __TIME___ __LINE__ µÈ
__LINE__£ºÔÚÔ´´úÂëÖвåÈ뵱ǰԴ´úÂëÐкţ»
__FILE__£ºÔÚÔ´ÎļþÖвåÈ뵱ǰԴÎļþÃû£»
__DATE__£ºÔÚÔ´ÎļþÖвåÈ뵱ǰµÄ±àÒëÈÕÆÚ
__TIME__£ºÔÚÔ´ÎļþÖвåÈ뵱ǰ±àÒëʱ¼ä£»
......