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 ÊôÐÔ´´½¨ÓÃÓÚ´
Ïà¹ØÎĵµ£º
#include <iostream>
#include <conio.h>
using namespace std;
typedef struct _INTTEST
{
int a;
}inttest;
int main()
{
inttest* p=new inttest[3];
p[1].a=10;
cou ......
ÏÂÃæ˵µ½µÄCÓïÑÔÖеÄ֪ʶ£¬ÎÒÖ»ÊÇÔÚ¹¤×÷Öо³£¼ûµ½»òÓõ½£¬µ«´ÓδÉΪʲô£¬½ñÌì²ÅÈ´µÀÔÀ´¼ò¼òµ¥µ¥ÏÂÃæÔÐÓýÕâÎÞÇîµÄ֪ʶµãºÍÎÒµÄäµã£¬ÊǸñßѧϰ±ß¼Ç¼ÁË¡£
Ô¤´¦ÀíÆ÷£¨Preprocessor£©
1 . ÓÃÔ¤´¦ÀíÖ¸Áî#define ÉùÃ÷Ò»¸ö³£Êý£¬ÓÃÒÔ±íÃ÷1ÄêÖÐÓжàÉÙÃ루ºöÂÔÈòÄêÎÊÌ⣩
#define ......
ÔÚ C API ÖпÉÓõĺ¯ÊýÁÐÔÚÏÂÃ棬²¢ÇÒÔÚÏÂÒ»½Ú¸üÏêϸµØÃèÊö¡£¼û20.4 C APIº¯ÊýÃèÊö¡£
mysql_affected_rows()
·µ»Ø±»×îеÄUPDATE, DELETE»òINSERT²éѯӰÏìµÄÐÐÊý¡£
mysql_close()
¹Ø±ÕÒ»¸ö·þÎñÆ÷Á¬½Ó¡£
mysql_connect()
Á¬½ÓÒ»¸öMySQL·þÎñÆ÷¡£¸Ãº¯Êý²»ÍƼö£»Ê¹ÓÃmysql_real_connect()´úÌæ¡£
mysql_change_user( ......
££i nclude <stdio.h>
££i nclude <dos.h>
££i nclude <conio.h>
££i nclude <graphics.h>
££i nclude <stdlib.h>
#ifdef __cplusplus
#define __CPPARGS ...
#else
#define __CPPARGS
#endif
#define MINBOXSIZE ......