Îļþ´¦Àíº¯ÊýÈçºÎʹÓã¿Ó÷¨¾ÙÀý£¬CÓëMFC
CÓïÑÔ£¬ÓÐʱºòÕæ²»µÃ²»ÅåËü£¬ÕÕÀí˵£¬Îļþ´¦Àíº¯ÊýÊÇûÓÐʲôºÃ½²µÄ£¬µ«¶ÔÓںܶàCÈëÃŵÄÈËÀ´Ëµ£¬ËƺõÒ²ÊÇÖµµÃ¾²ÐÄƷζһ·¬µÄ¡£
CÖеÄÎļþ´¦Àíº¯Êý²¢²»ºÜ¶à£¬¶ø³£Óõģ¬Ëƺõ¸üÉÙ¡£
º¯Êý²»ÄÑ£¬µ«²¢²»´ú±íÎļþ´¦ÀíÒ²²»ÄÑ¡£ËƺõÓÖÒªÓеãÅÜÌâÁË£¬ÎÒ×ÜÊÇϲ»¶ÅÜÌâ¡£Éϼ¸Ìì×öÃΣ¬Ãε½ÎÒµôµ½ÔÂÇòÉÏÈ¥À²……
¶ÔÎļþµÄ²Ù×÷£¬Î޷ǾÍÊÇ´ò¿ª¡¢¶Áд¡¢µ÷Õû¶ÁдƫÒÆÖ¸ÕëÒÔ¼°¹Ø±Õ£¬Ëƺõôʲ¿É˵µÄ£¬Ò²ÐíÊÂʵҲµÄÈ·Èç´Ë¡£»¹ÊÇÈÃÎÒÃÇÀ´¿´Ò»¶Î¾µä´úÂë°É£¬Õâ´úÂë¿ÉÊÇÎÒ×Ô¼ºÐ´µÄ¡£
FILE* fp = fopen(”test.txt”, “r”); assert(fp); //´ò¿ªÎļþ£¬¸øÒ»¸ö¶ÏÑÔ£¬ÕâÊÇÒ»ÖÖºÃÏ°¹ß
fseek(fp, 0, SEEK_END); //°ÑÆ«ÒÆÖ¸ÕëÖ¸ÏòÎļþµÄ½áβ
unsigned int nlen = ftell(fp); //·µ»Øµ±Ç°µÄÆ«ÒÆÖ¸Õ룬Ҳ¾ÍÊÇ·µ»Ø¸Õ¸ÕÉ趨µÄÎÄβλÖÃ
fseek(fp, 0, SEEK_SET); //°Ñ¶ÁдƫÒÆÖ¸ÕëÖ¸ÏòÎļþµÄ¿ªÍ·
char* const _psz = (char*)malloc(nlen + 1);
//ÉêÇëÒ»¶Î¶ÑÄڴ棬ÕâÀïµÄ_pszΪʲôҪ±»constÐÞÊÎÄØ£¿
unsigned int size = fread(_psz, sizeof(char), nlen, fp); //¶Á³öÎļþµÄÄÚÈÝ
_psz[size] = ‘\0′; //×¢Ò⣬±ØÐëÒªÔÚ×Ö·û´®µÄ½áβ´¦Ìí¼Ó½áÊø±êÖ¾£¬·ñÔò£¬ºßºß£¡
fclose(fp); //¹Ø±ÕÎļþ
…… //¶«¸ã¸ã£¬Î÷¸ã¸ã
free(_psz)£» //¹é»¹¶ÑÄÚ´æ
ʵÔÚÊÇÌ«¼òµ¥ÁËÊÇ°É£¿Êǵģ¬ÎÒÕýÕâÑùÈÏΪÄØ¡£
ÔÚ¶ÁÎļþµÄʱºò£¬Óе㶫Î÷»¹ÊÇҪ˵˵µÄ¡£ÒòΪÎÒÃǶ¼Ìý˵¹ý£¬ÎļþÓÐÁ½ÖÖ¸ñʽ£¬Ò»ÖÖÊÇÎı¾£¬Ò»ÖÖÊǶþ½øÖÆ¡£Îı¾Îļþ£¬µ±È»£¬ÎÒÃDz»Ïë˵ʲôÁË£¬µ«¶þ½øÖÆÎļþµÄ¶Áд£¬È´ÖµµÃÒ»Ìá¡£¶þ½øÖƵÄÎļþÕâÑù´ò¿ª£º
FILE* fp = fopen(”test.exe”, “rb”); assert(fp);
µ±È»£¬¿ÉÖ´ÐÐÎļþÖ»²»¹ýÊǶþ½øÖÆÎļþµÄÒ»¸ö´ú±í£¬ÔÚʹÓöÁд±êÖ¾µÄʱºò£¬ÎÒÃÇÐèÒª”b”ºó׺£¬±íÃ÷´ò¿ªµÄÊǶþ½øÖƵÄÎļþ¡£Æäʵ£¬Õâ²»Êǹؼü£¬¶øÕýÕæ¹Ø¼üµÄ²¿·ÖÊǶÔÎļþµÄ¶Áд£¬Õâ·Ý´úÂëÓеãÈßÓ࣬µ«²»Ð´ÓÖŸøÈËÄÖ³öÇ¿ÆÈÖ¢¡£
fseek(fp, 0, SEEK_END); //»ñÈ¡Îļþ´óС
size_t nlen = ftell(fp);
fseek(fp, 0, SEEK_SET);
unsigned char* const _psz = (unsigned char*)malloc(nlen + 1);
//ÏÔÈ»£¬ÉêÇëµÄÄÚ´æÓ¦¸ÃÊÇBYTE¸ñʽ
fread(_psz, sizeof(unsigned char), nlen, fp); //ÓÉÓÚÊǶþ½øÖƵÄÎļþ£¬ÎÒÃDz»±ØÔÙ¶ÔÄÚ´æ×ö´¦Àí
fclose(fp);
ͨ³££¬ÕâÖÖÓ÷¨²»³£¼û£¬¶ø¸ü¶àµÄ¶Ô¶þ½øÖÆÎļþµÄ¶Áд£¬ÊdzöÏÖÔÚsocketÉÏ¡£±ÈÈ磬ÎÒÃÇÒª´ÓÍøÉϸü
Ïà¹ØÎĵµ£º
#include <stdio.h>
#include <string.h>
int
main(void)
{
char str[] =
"3BVPSq4xF.K?=u#,"
"G'K<MrDnRr7gH%#,"
"XKf<f%G`w^=?C<#,"
"HgU_AnNR?*PDQU#,"
......
ÔÚÉÏһƪÖÐÎÒÃÇÒѾʹÓÃcÓïÑÔʵÏÖÁËÒ»¸ö×î¼òµ¥µÄÀ©Õ¹Ä£¿é£¬ÕâһƪÖн«ÔÚÆä»ù´¡ÉϽøÐй¦Äܵķḻ¡£Ê×ÏÈÀ´¿¼ÂÇÈçºÎ´ÓÍⲿµÄPythonÏòCÄ£¿é´«µÝ½ø²ÎÊý£¬foo_bar2չʾÁËÈçºÎÏòCÄ£¿é´«µÝÕûÊý£¬¸¡µãÊý£¬×Ö·û´®Èý¸ö²ÎÊý£¬ÆäÖÐ"ids"Ö¸Ã÷ÁË´«Èë²ÎÊýµÄÊý¾ÝÀàÐÍ¡£PyArg_ParseTuple¸ºÔð¶Ôargs½øÐнâÎö£¬Èô½âÎöʧ°ÜÔò·µ»Ø0.´úÂë#include&n ......
½ñÌì¿´K&RµÄÊéµÄʱºò˳±ãÎÂÏ°ÁËCµÄÁíÒ»ÖØÒªÊý¾Ý½á¹¹bit-fields£¬ÎÒÏëbit-fieldsÔÚ±àдµ×²ãÇý¶¯
Çý¶¯³ÌÐòµÄʱºòÓ¦¸Ã±È½ÏºÃÓã¬Ëü¿ÉÒÔÈÆ¿ª"&"ºÍ"|"½øÐÐλ²Ù×÷£¬¶øÇÒ¸ü¼Ó½ÚÔ¼ÄÚ´æ¿Õ¼ä¡£·Ï»°²»¶à˵
ÁË£¬»¹ÊÇÏÈÀ´¿´¿´ËüµÄÕæÃæÄ¿°É£º
bit-fieldÀ´Ô´:
bit-fieldÊÇΪÁ˽ÚÔ¼´æ´¢¿Õ¼ä¶ø´´ÔìµÄÒ»ÖÖÊý¾ ......
Ò»¡¢³ÌÐòÕæÚÐ
1.³ÌÐò¾ÍÊÇ“°áÊý”
¶¯×÷£º¶ÁÈ¡——¼¼Êõ——д³ö£¨ÊäÈë——´¦Àí——Êä³ö£©
Êý¾Ý½á¹¹¾ö¶¨Êý¾ÝÈçºÎ×éÖ¯£¬°á¶¯ÆðÀ´Ð§Âʽϸß
Ëã·¨ÓïÑÔ¾ ......
int svd(int m,int n,int withu,int withv,double eps,double tol,
double *a, double *q, double *u, double *v, double *vt)
{
int i,j,k,l,l1,iter,retval;
double c,f,g,h,s,x,y,z;
double *e;
e = (double *)calloc(n,sizeof(double));
retval = 0;
/* Cop ......