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

c/c++ string


1.±¾ÕÂ˼άµ¼Í¼£º



Example1:
char
*strcpy(char *target, const char *source) {
  char *t = target;

  // Copy the contents of source into target.
 
while(*source) *target++ = *source++;
  // Null-terminate the
target.
  *target = '\0';
  // Return pointer to the
start of target.
  return t;
}
Example2:
void
*memmove(void *target, const void *source, size_t count)
Õâ¸öº¯Êý¼´Ê¹
ÊÇÔÚÔ´ºÍÄ¿µÄ×Ö·û´®ÓÐËùÖØµþʱ²Ù×÷Ò²Äܳɹ¦£¬ËäÈ»sourceΪconst£¬µ«ÊÇÆäÖ¸ÏòµÄarrayÒ²¿ÉÄܱ»Ð޸ġ£
2.
CÐÍ×Ö·û´®²Ù×÷ʵÀý£º
Ex1.»ù±¾²Ù×÷
/*
*

=====================================================================================

*
*       Filename:  2-1.cpp
*
*   
Description:  Fundamental Operations in C Type String
*
*       
Version:  1.0
*        Created:  05/11/2010 10:43:11 AM
*      
Revision:  none
*       Compiler:  gcc
*
*        
Author:  gnuhpc (http://blog.csdn.net/gnuhpc)
,
warmbupt@gmail.com
*        Company:  IBM CDL
*
*

=====================================================================================

*/
#include 
#include 
using namespace std;
int main(int argc, char *argv[])
{

    char strA[7]="UP";
    char strB[5]="DOWN";
   
char strC[5]="LEFT";
    char strD[6]="RIGHT";
   
/*Display */
    cout << "Here are the strings: " <<
endl;


Ïà¹ØÎĵµ£º

½»»»Á¬¸ö¶ÔÏóµÄÖµ£¨C/C++?JAVA£©

ÈçºÎ½»»»Á½¸ö±äÁ¿µÄÖµ£º
CÓïÑÔÖеĴ«Öµ´úÂëÈçÏ£º
int change(int x,int y)
{
int temp=x;
x=y;
y=temp;
}
CÓïÑÔÖеĴ«Ö·´úÂëÈçÏ£º
int change(int *p,int *q)
{
int temp=*p;
*p=*q;
*q=temp;
}
ʹÓÃC++ÖеÄÒýÓÃÀàÐÍ´úÂëÈçÏÂ:
int change(int &x,int &y)
{
int temp=x;
x=y;
y=temp;
}
JAV ......

¡¾C\C++ÓïÑÔÈëÃÅÆª¡¿ λÔËËã


»Ø¹Ë֮ǰµÄƪ·ù£¬CÓïÑÔµÄÖ÷Ì岿·Ö»ù±¾ÒѾ­½éÉÜÍêÁË¡£Ö®ËùÒÔûÓнéÉÜC++µÄÏà¹ØÌØÐÔÊÇÒòΪÔÚ֮ǰµÄÎÄÕÂÖÐCºÍC++ÔÚÕâЩ·½Ãæ¶¼Óй²ÐÔ£¬ËùÒÔÔÚÃæÏò¶ÔÏó֮ǰ¡£ÎÒÃÇÏȰÑÕâЩ¹²ÐÔ¸ø½éÉÜÍê¡£Ò²¾ÍÊÇ˵ÔÚ½éÉÜÃæÏò¶ÔÏó֮ǰ£¬ËùÓеÄÎÄÕ¶¼ÊÇCC++Öж¼ÄÜʹÓõġ£´ÓÕâµãÉÏÀ´¿´£¬ÏÖÔÚÕý¼«Á¦·Ü¶·ÓÚC++Õ½ÏßÉϵijõѧÕß»¹ÊǺÜÓÐÓô¦µÄ¡£
±¾Æª¼ ......

c/c++Í·Îļþ£¬±£´æ£¬±¸ÓÃ

 
C¡¢´«Í³ C++
#include <stdio.h>¡¡¡¡¡¡¡¡ //¶¨ÒåÊäÈ룯Êä³öº¯Êý
#include <stdlib.h>¡¡¡¡¡¡¡¡//¶¨ÒåÔÓÏÊý¼°ÄÚ´æ·ÖÅ亯Êý
#include <string.h>¡¡¡¡¡¡¡¡//×Ö·û´®´¦Àí
#include <assert.h>¡¡¡¡¡¡¡¡//É趨²åÈëµã
#include <ctype.h>¡¡¡¡¡¡¡¡ //×Ö·û´¦Àí
#include <errno.h&g ......

Delphiµ÷ÓÃVC++6.0±àдµÄDll

ÓÃVC++6.0±àдÁËÒ»¸ö¼òµ¥µÄdll£¬ÀïÃæ°üº¬Ò»¸ö¼õ·¨º¯Êýsubtract(int a,int b)£¬DllÃüÃûΪff.Dll
´úÂëÈçÏ£º
1.ff.cpp:
// ff.cpp : Defines the entry point for the DLL application.
//
#include "StdAfx.h"
#include "ff.h"
BOOL APIENTRY DllMain( HANDLE hModule,
        ......

C/C++ ÖеÄÒÆÎ»²Ù×÷ʰÒÅ

ÒýÑÔ
×î½ü±ÊÕßÒ»Ö±ÔÚ×öJPEGµÄ½âÂ빤×÷£¬·¢ÏÖÓÃÍêȫʹÓùþ·òÂüÊ÷½øÐнâÂë±È½Ï·Ñʱ£¬¶øÊ¹Óñí½á¹¹´æ´¢±àÂëºÍÖµµÄ¶ÔÓ¦¹ØÏµ±È½Ï¿ì½Ý£¬µ«ÊÇÒ²´æÔڱȽÏÄÑ´¦ÀíµÄµØ·½£¬±ÈÈç½âÂ빤×÷ͨ³£ÊÇÒÔλΪµ¥Î»µÄ²Ù×÷£¬ÕâÀï±ØÈ»»áÉæ¼°µ½ÒÆÎ»²Ù×÷£¬¶ø±ÊÕß֮ǰ¶ÔλµÄ²Ù×÷ºÜÉÙ£¬¾­ÑéºÜǷȱ£¬¾­¹ýÕâ´ÎÀúÁ·ÖÕÓÚ·¢ÏÖÁËÒ»¸ö×Ô¼ºÔø¾­ºöÊӵĶ«Î÷£¬ÄÇ¾Í ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ