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

±à³ÌÒÕÊõ(C/C++)


1¡¢¿ìËÙ³õʼ»¯
char  *str = new [size];
str[0]='\0';
 
 
2¡¢memcpyµÄÃîÓÃ
 
ÊÔÌâ6£ºÒÑÖªWAVÎļþ¸ñʽÈçÏÂ±í£¬´ò¿ªÒ»¸öWAVÎļþ£¬ÒÔÊʵ±µÄÊý¾Ý½á¹¹×éÖ¯WAVÎļþÍ·²¢½âÎöWAV¸ñʽµÄ¸÷ÏîÐÅÏ¢¡£
  WAVEÎļþ¸ñʽ˵Ã÷±í
Æ«ÒÆµØÖ· ×Ö½ÚÊý Êý¾ÝÀàÐÍ ÄÚ ÈÝ
ÎļþÍ·
00H 4 Char "RIFF"±êÖ¾
04H 4 int32 Îļþ³¤¶È
08H 4 Char "WAVE"±êÖ¾
0CH 4 Char "fmt"±êÖ¾
10H 4   ¹ý¶É×Ö½Ú£¨²»¶¨£©
14H 2 int16 ¸ñʽÀà±ð
16H 2 int16 ͨµÀÊý
18H 2 int16
²ÉÑùÂÊ£¨Ã¿ÃëÑù±¾Êý£©£¬±íʾÿ¸öͨµÀµÄ²¥·ÅËÙ¶È
1CH 4 int32 ²¨ÐÎÒôƵÊý¾Ý´«ËÍËÙÂÊ
20H 2 int16 Êý¾Ý¿éµÄµ÷ÕûÊý£¨°´×Ö½ÚËãµÄ£©
22H 2   ÿÑù±¾µÄÊý¾ÝλÊý
24H 4 Char Êý¾Ý±ê¼Ç·û£¢data£¢
28H 4 int32 ÓïÒôÊý¾ÝµÄ³¤¶È
  ½â´ð£º
  ½«WAVÎļþ¸ñʽ¶¨ÒåΪ½á¹¹ÌåWAVEFORMAT£º
typedef struct tagWaveFormat
{
 char cRiffFlag[4];
 UIN32 nFileLen;
 char cWaveFlag[4];
 char cFmtFlag[4];
 char cTransition[4];
 UIN16 nFormatTag ;
 UIN16 nChannels;
 UIN16 nSamplesPerSec;
 UIN32 nAvgBytesperSec;
 UIN16 nBlockAlign;
 UIN16 nBitNumPerSample;
 char cDataFlag[4];
 UIN16 nAudioLength;   } WAVEFORMAT;
  ¼ÙÉèWAVÎļþÄÚÈݶÁ³öºó´æ·ÅÔÚÖ¸Õëbuffer¿ªÊ¼µÄÄÚ´æµ¥ÔªÄÚ£¬Ôò·ÖÎöÎļþ¸ñʽµÄ´úÂëºÜ¼òµ¥£¬Îª£º WAVEFORMAT waveFormat;
memcpy( &waveFormat, buffer,sizeof( WAVEFORMAT ) );
  Ö±½Óͨ¹ý·ÃÎÊwaveFormatµÄ³ÉÔ±£¬¾Í¿ÉÒÔ»ñµÃÌØ¶¨WAVÎļþµÄ¸÷Ïî¸ñʽÐÅÏ¢¡£
  ÆÊÎö£º
  ÊÔÌâ6¿¼²éÃæÊÔÕß×éÖ¯Êý¾Ý½á¹¹µÄÄÜÁ¦£¬Óо­ÑéµÄ³ÌÐòÉè¼ÆÕß½«ÊôÓÚÒ»¸öÕûÌåµÄÊý¾Ý³ÉÔ±×é֯Ϊһ¸ö½á¹¹Ì壬ÀûÓÃÖ¸ÕëÀàÐÍת»»£¬¿ÉÒÔ½«memcpy¡¢memsetµÈº¯-ÊýÖ±½ÓÓÃÓڽṹÌ嵨ַ£¬½øÐнṹÌåµÄÕûÌå²Ù×÷¡£
͸¹ýÕâ¸öÌâ¿ÉÒÔ¿´³öÃæÊÔÕߵijÌÐòÉè¼Æ¾­ÑéÊÇ·ñ·á¸»¡£


Ïà¹ØÎĵµ£º

linux c ¶ÁÈ¡ÎļþÐÐÊý

linux c ¶ÁÈ¡ÎļþÐÐÊý²ÎÕÕwc ϵͳÃüÁî±àдµÄº¯ÊýÈçÏ£º
#include <fcntl.h>
#include <stdlib.h>
#define MAXBSIZE 65536
u_long file_wc(char *file)
{
register u_char *p;
register short gotsp;
register int ch, len;
register u_long linect, charct;
int fd;
u_char buf[MAXBSIZE];
......

c/c++ ÄÚ´æ¶ÔÆë sizeof

   һƪ½²¶ÔÆë±È½ÏºÃµÄÎÄÕ£¬×ªÌùÈçÏÂ:
´óÖ±ê×¢Ò»¶þ:
1.ÄÚ´æ¶ÔÆë:¼ÆËã»úϵͳ¶Ô»ù±¾ÀàÐÍÊý¾ÝÔÚÄÚ´æÖдæ·ÅµÄλÖÃÓÐÏÞÖÆ£¬ËüÃÇ»áÒªÇóÕâЩÊý¾ÝµÄÊ×µØÖ·µÄÖµÊÇij¸öÊýk(ͨ³£ËüΪ4»ò8)µÄ±¶ÊýkÔò±»³ÆÎª¸ÃÊý¾ÝÀàÐÍµÄ¶ÔÆëÄ£Êý(alignment modulus)
2.²»Í¬±àÒëÆ÷ĬÈϵÄ×î´ó¶ÔÆë×Ö½ÚÊýÊDz»Ò»ÑùµÄ,±ÈÈçvc==8,gcc==4,¿ÉÒÔͨ¹ ......

½â¾öCºÍC++ÖÐÉú³ÉµÄEXEÎļþÖ´Ðк󴰿ھÍÏûʧÁË£¡

Óô˷¨Ç°È·±£ÄãµÄCÔ´´úÂëÊÇÎÞ´íµÄ~~
½â¾ö°ì·¨£º
C:
ÔÚÖ÷º¯Êýºó¼Ógetch()»òch=getch();    (ÈóÌÐòµÈ´ýÄã°´ÏÂÈÎÒâ¼ü£¬ÔÙ¼ÌÐøÖ´ÐÐÏÂÃæµÄÓï¾ä)
C++:
1.°üº¬Í·Îļþʱ£º #include   <stdlib.h>/*header file£¬ÒòΪÔÚstdlib.hÍ·ÎļþÖж¨ÒåÁËsystem()º¯Êý*/
2.ÔÚ×îºóÒ»¾ä¼ÓÉÏ£ºsystem("PAUSE ......

³£ÓÃC¿âº¯ÊýÓëWIN32º¯Êý±È½ÏÒ»ÀÀ±í


Win32 Equivalents for C Run-Time Functions
ID: Q99456
The information in this article applies to:
Microsoft Win32 Application Programming Interface (API), included with:
Microsoft Windows NT, versions 3.1, 3.5, 3.51
Microsoft Windows 95
 
SUMMARY
Many of the C Run-time functions have ......

JAVA²Ù×÷XMLµÄÍêÕûÀý×Ó——W3C DOMƪ

ÕâÊÇÒ»¸öÓÃJAVA W3C DOM ½øÐÐXML²Ù×÷µÄÀý×Ó£¬°üº¬Á˲éѯ¡¢Ôö¼Ó¡¢Ð޸ġ¢É¾³ý¡¢±£´æµÄ»ù±¾²Ù×÷¡£½ÏÍêÕûµÄÃèÊöÁËÒ»¸öXMLµÄÕû¸ö²Ù×÷Á÷³Ì¡£ÊʺϸÕÈëÃÅJAVA XML²Ù×÷µÄÅóÓѲο¼ºÍѧϰ¡£
¼ÙÉèÓÐXMLÎļþ£ºtest1.xml
<?xml version="1.0" encoding="UTF-8"?>
<books>
 <book>
  <name>¹þÀï²¨Ì ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ