Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

cÎļþ²Ù×÷

#include <stdio.h>
#include <stdlib.h> //use malloc, free
#include <string.h> //use memset
#include <ctype.h> //use isdigit
#define ERROR_ILLEGAL_CHAR 1 //define error illegal character as 1
#define ERROR_NUMBERS_DIF 2 //define error numbers is not the same in different line as 2
#define ERROR_FILE_ERROR 3 //define error file error as 3
typedef struct _node{
int num;
struct _node *next;
}node;
node *head = NULL;
void insert(int num)
{
if (NULL == head)
{
head = (node*)malloc(sizeof(node));
(*head).num = num;
(*head).next = NULL;
}
else
{
node* p = head;
while (NULL != p->next) //move to end
{
p = p->next;
}
p->next = (node*)malloc(sizeof(node));
p = p->next;
(*p).num = num;
(*p).next = NULL;
}
}
void output(int rows, int cols)
{
node *p = head;
if (NULL == p)
return;
for (int i=0; i<rows; i++)
{
for (int j=0; j<cols; j++)
{
printf("%-4d", p->num);
p = p->next;
}
printf("\n");
}
}
int getData(int *row, int *col)
{
FILE *f;
char ch = 0;
char t[100];
int index = 0;
int countline = 0;
int totalline = 0;
/*ÈôÎļþÄÚÈÝÊÇÔÚ³ÌÐòÖÐÒÔ¶þ½øÖÆ·½Ê½´ò¿ªÐ´ÈëµÄÊý¾ÝÔò½«´ò¿ª·½Ê½¸ÄΪ"rb"*/
if ((f=fopen("D:\\source\\read.dat", "r")) == NULL)
{
return ERROR_FILE_ERROR;
}
memset(t, -1, 100);
do
{
ch = fgetc(f);
if (isdigit(ch))
{
t[index++] = ch;
continue;
}
else
{
switch (ch)
{
case ',':
case '.':
case ' ':
if ((-1 != t[0]))
{
insert(atoi(t));
memset(t, -1, 100);
index = 0;
countline++;
}
break;
case EOF:
case '\n':
if ((-1 == t[0]) && (0 == countline))//null line
{
break;
}
else
{
if (-1 != t[0])
{
insert(atoi(t));
memset(t, -1, 100);
index = 0;
countline++;
}
}
if (0 != countline)
{
if (0 == totalline)
{
totalline = countline;
*col = totalline;
}
else
{
if (countline != totalline)
{
return ERROR_NUMBERS_DIF;
}


Ïà¹ØÎĵµ£º

ÓÃCдµÄ3DÃÔ¹¬

          Boss˵£¬Òª¿´OpenGL£¬¿´ÁË¿ìÒ»¸öÔ£¬×ÜËã³öÁ˸öÏñÑùµÄ¶«Î÷£¬ÓÃCдÁ˸ö3DÃÔ¹¬£¬
ËäȻֻÓÐ350ÐÐ
       ´úÂ룬²»¹ý±ßѧ±ßд£¬×ã×ãдÁËÒ»ÖÜʱ¼ä£¬»¹ÊÇСÓгɾ͸еģ¬»î»î»î£¡
         &n ......

C# µ÷Óà c++ dll µÄһЩÎÊÌâ×ܽá

1.c++µÄµ½´¦º¯ÊýÖ»ÒªÔÚº¯ÊýÉêÃ÷µÄʱºò¼Ó¸öµ¼³ö¹Ø¼ü×־ͿÉÒÔÁË
2.²ÎÊýÀàÐÍÎÊÌâ,
Ò»°ãµÄc++ÖÐchar * ¶ÔÓ¦ c#ÖеÄstring
¶øc++ÖÐ char **ÀàÐ͵IJÎÊý¶ÔÓ¦c#ÖÐ ref string ÕâÖÖÒ»°ã¶¼ÊÇÓÃÀ´·µ»Ø×Ö·û´®µÄ!
3.º¯ÊýÈë¿ÚÎÊÌâ,Ò»°ã»á³öÏÖ "ÕÒ²»µ½Èë¿Úµã" Õâ¸öÎÊÌâ²»ÊÇÓÉÄãÒýÆðµÄ,¶øÊÇϵͳ×Ô¼º°ÑÃû×Ö¸ÄÁË,¸Ä³ÉʲôÑùµÄÃû×Ö½¨ÒéÄãÓà ......

¹ØÓÚAJAX¡¢B/S¡¢C/SµÄ¼¸¸ö˼¿¼


B/SΪºÎÄÑÓÚÌṩºÃµÄÓû§½»»¥ÌåÑé?
×î´óÎÊÌâÓм¸¸ö£º
¡¡¡¡(1)ÎÞ״̬µÄHTTPЭÒé
¡¡¡¡WINDOWS´°Ìå¼äÄܹ»Í¨¹ýÄÚ´æÖ±½Ó½»»»ÐÅÏ¢£¬µ«×÷ΪB/S¼Ü¹¹Í¨Ñ¶»ù´¡Ð­ÒéµÄHTTPÊÇÎÞ״̬µÄ¡£
¡¡¡¡Èç¹û½«ä¯ÀÀÆ÷¿´³ÉÊÇ¿ÍÈË£¬Web·þÎñÆ÷¿´³ÉÊÇÂùݣ¬ÔÚHTTPЭÒéµÄ¹ÜÀí֮ϣ¬»á³öÏÖÕâÖÖÇé¿ö£º²»¹Üij¿ÍÈËÀ´·Ã¶àÉٴΣ¬Web·þÎñÆ÷¶¼½«ÆäÊÓΪµ ......

ÔÚVC6ÖÐʹÓÃc API·½Ê½Á¬½ÓMySQLÊý¾Ý¿â

ÔÚVC6ÖÐʹÓÃc API·½Ê½Á¬½ÓMySQLÊý¾Ý¿â
Ò»¡¢»·¾³ÅäÖÃ
1¡¢ÔÚMySqlµÄ¹Ù·½ÍøÕ¾ÏÂÔØmysql-connector-c-noinstall£¬²¢½«½âѹºóµÄbinºÍincludeÎļþ¼Ð¿½±´µ½MysqlµÄ°²×°Ä¿Â¼
2¡¢ÉèÖÃVC6»·¾³£¬ÔÚvc¹¤¾ß-Ñ¡Ïî-Ŀ¼£¬¼ÓÈë¸Õ²ÅµÄIncludeÎļþ¼ÐµÄ·¾¶£¬ÀýÈ磺C:\Program Files\MySQL\MySQL Server 5.1\include
¶þ¡¢¹¤³ÌÉèÖÃ
3¡¢½«li ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ