Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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ÌÐòÉè¼Æ¾­ÑéÊÇ·ñ·á¸»¡£


Ïà¹ØÎĵµ£º

Window+GCC+CDTÓÃEclipse¿ª·¢C¡¢C++

Eclipse³ýÁË¿ÉÒÔ開發JavaÖ®Í⣬還Ö§Ô®ÁË許¶à語ÑÔ£¬現ÔÚÏȽé紹
C¡¢C++µÄ開發環¾³設¶¨£¬ÒÔááÓÐ機會ÔÙ½é紹ÆäËüµÄ¡£Enjoy it£¡
OS£ºWindows XP Professional SP1
ʹÓð汾£ºEclipse 2.1.2
Ò».Ê×ÏÈÒªÏÂ載CDT£¬Eclipse 2.1.2 ......

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¿âº¯ÊýÓë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>¹þÀï²¨Ì ......

ÔÚandroid ÉÏÃæ ÔËÐд¿C helloworld

ÓÉÓÚÒª²âϵͳµÄCPUÊôÐÔ£¬ÐèÒª¶ÀÁ¢±àÒëÓ¦ÓóÌÐò£¬±ãÊÔÁËϱàÒë´¿C ³ÌÐò£¬²âÊÔͨ¹ý¡£
CC         := $(NDK_BASE)/toolchain/arm-eabi/bin/arm-eabi-gcc
AR         := $(NDK_BASE)/toolchain/arm-eabi/bin/arm-eabi-ar
INC  & ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ