Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB
ÈÈÃűêÇ©£º c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 ×îÐÂÎÄÕ : c

JNI µ÷ÓÃC/C++

JNIµ÷ÓÿÉÒÔ¼Ó¿ìJAVAµÄÔËÐÐËÙ¶È£¬Ö÷ÒªÊǽ«¹Ø¼üµÄ´úÂëÓÃC/C++ »òÕßmfcÍê³É£¬ÔÚÕâÀïÌùÉÏÎÒдµÄÒ»¶Î´úÂ룬ÓÐÐËȤµÄ¿ÉÒԲο¼£º
Í·Îļþ£º
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class cn_com_wintone_TLConnectJNI */
#ifndef _Included_cn_com_wintone_TLConnectJNI
#define _Included_cn_com_wintone_TLConnectJNI
#ifdef __cplusplus
extern "C" {
#endif
/*
 * Class:     cn_com_wintone_TLConnectJNI
 * Method:    Prt
 * Signature: ()V
 */
JNIEXPORT void JNICALL Java_cn_com_wintone_TLConnectJNI_Prt
  (JNIEnv *, jobject);
JNIEXPORT jboolean JNICALL Java_cn_com_wintone_TLConnectJNI_initOCRTL
  (JNIEnv *envPram, jobject);
/*
 * Class:     cn_com_wintone_TLConnectJNI
 * Method:    uninitOCRTL
 * Signature: ()Z
 */
JNIEXPORT jboolean JNICALL Java_cn_com_wintone_TLConnectJNI_uninitOCRTL
  (JNIEnv *envPram, jobject);
/* ......

JNI µ÷ÓÃC/C++

JNIµ÷ÓÿÉÒÔ¼Ó¿ìJAVAµÄÔËÐÐËÙ¶È£¬Ö÷ÒªÊǽ«¹Ø¼üµÄ´úÂëÓÃC/C++ »òÕßmfcÍê³É£¬ÔÚÕâÀïÌùÉÏÎÒдµÄÒ»¶Î´úÂ룬ÓÐÐËȤµÄ¿ÉÒԲο¼£º
Í·Îļþ£º
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class cn_com_wintone_TLConnectJNI */
#ifndef _Included_cn_com_wintone_TLConnectJNI
#define _Included_cn_com_wintone_TLConnectJNI
#ifdef __cplusplus
extern "C" {
#endif
/*
 * Class:     cn_com_wintone_TLConnectJNI
 * Method:    Prt
 * Signature: ()V
 */
JNIEXPORT void JNICALL Java_cn_com_wintone_TLConnectJNI_Prt
  (JNIEnv *, jobject);
JNIEXPORT jboolean JNICALL Java_cn_com_wintone_TLConnectJNI_initOCRTL
  (JNIEnv *envPram, jobject);
/*
 * Class:     cn_com_wintone_TLConnectJNI
 * Method:    uninitOCRTL
 * Signature: ()Z
 */
JNIEXPORT jboolean JNICALL Java_cn_com_wintone_TLConnectJNI_uninitOCRTL
  (JNIEnv *envPram, jobject);
/* ......

PHPµ÷ÓÃC±à³Ì×ܽá(windows)

Ò».»·¾³µÄ°²×°
   
    ÏÂÔØ°²×°°ü£¬GoogleÉÏËÑË÷php+apache+sqlµÄ°²×°°ü²¢°²×°¡£
¶þ.À©Õ¹±à³Ì
    Õë¶ÔÔÚPHP»·¾³ÏµôÓÃC±à³Ì(c³ÌÐò±àÒëµÄdll)£¬Ö÷ÒªÓÐÒÔÏÂÁ½ÖÖ·½Ê½¡£
   
    1.ÀûÓÃATL¹¹½¨DLL×é¼þ£¬È»ºóÔÙPHPÀïÃæÖ±½Óµ÷Ó㬵÷Ó÷½·¨Îª
   
    <?php
    $com = new COM("atltest.Fun") or die("ÎÞ·¨½¨Á¢COM×é¼þ");
    echo $com->show(2);
    ?>
   
     2.°´ÕÕlinuxϵķ½Ê½À´µ÷ÓÃc³ÌÐòдµÄdll¡£
    ÕâÖÖ·½Ê½Ö÷Òª²½ÖèΪ£º
    (1).ÔÚlinuxÏÂÓÃphpÉú³É¹¤³ÌÎļþ£¬È»ºó¿½±´µ½windows,(ΪʲôÕâÑù×ö£¬ÒòΪwindowsÏÂphpûÓÐÀ©Õ¹±à³Ì)
    (2).ÔÚwindows϶Ôphp¹¤³ÌÎļþµÄphp_xxx.hºÍxxx.c±à¼­,Ìí¼ÓÀ©Õ¹µÄº¯Êý(·½·¨),È»ºó±àÒë,Éú³ÉÀ©Õ¹DLL.
    (3).°ÑÉú³ÉµÄDLL¿½±´µ½phpµÄÀ©Õ¹µ÷Ó÷¾¶ÀïÃæ£¬ÔÙÔÚphp.iniÀïÃæÌí¼ÓÉú³ÉµÄDLLÖ§³Ö¡£
    (4).× ......

PHPµ÷ÓÃC±à³Ì×ܽá(windows)

Ò».»·¾³µÄ°²×°
   
    ÏÂÔØ°²×°°ü£¬GoogleÉÏËÑË÷php+apache+sqlµÄ°²×°°ü²¢°²×°¡£
¶þ.À©Õ¹±à³Ì
    Õë¶ÔÔÚPHP»·¾³ÏµôÓÃC±à³Ì(c³ÌÐò±àÒëµÄdll)£¬Ö÷ÒªÓÐÒÔÏÂÁ½ÖÖ·½Ê½¡£
   
    1.ÀûÓÃATL¹¹½¨DLL×é¼þ£¬È»ºóÔÙPHPÀïÃæÖ±½Óµ÷Ó㬵÷Ó÷½·¨Îª
   
    <?php
    $com = new COM("atltest.Fun") or die("ÎÞ·¨½¨Á¢COM×é¼þ");
    echo $com->show(2);
    ?>
   
     2.°´ÕÕlinuxϵķ½Ê½À´µ÷ÓÃc³ÌÐòдµÄdll¡£
    ÕâÖÖ·½Ê½Ö÷Òª²½ÖèΪ£º
    (1).ÔÚlinuxÏÂÓÃphpÉú³É¹¤³ÌÎļþ£¬È»ºó¿½±´µ½windows,(ΪʲôÕâÑù×ö£¬ÒòΪwindowsÏÂphpûÓÐÀ©Õ¹±à³Ì)
    (2).ÔÚwindows϶Ôphp¹¤³ÌÎļþµÄphp_xxx.hºÍxxx.c±à¼­,Ìí¼ÓÀ©Õ¹µÄº¯Êý(·½·¨),È»ºó±àÒë,Éú³ÉÀ©Õ¹DLL.
    (3).°ÑÉú³ÉµÄDLL¿½±´µ½phpµÄÀ©Õ¹µ÷Ó÷¾¶ÀïÃæ£¬ÔÙÔÚphp.iniÀïÃæÌí¼ÓÉú³ÉµÄDLLÖ§³Ö¡£
    (4).× ......

c/c++¶ÁдÎļþ

#include<stdlib.h>
#include<iostream>
#include<string.h>
using namespace std;
int main(void)
{
FILE *fp, *fp2;
char buf[1024*300];
fp = fopen("in.txt", "rb");
fp2 = fopen("out.txt", "wb+");
fseek(fp, 0, SEEK_END);
int iLen = ftell(fp);
cout<<"iLen: "<<iLen<<endl;
fseek(fp, 0, SEEK_SET);
fread(buf, 1, iLen, fp);
fwrite(buf, 1, iLen, fp2);
fclose(fp);
fclose(fp2);
return 0;
} ......

c/c++¶ÁдÎļþ

#include<stdlib.h>
#include<iostream>
#include<string.h>
using namespace std;
int main(void)
{
FILE *fp, *fp2;
char buf[1024*300];
fp = fopen("in.txt", "rb");
fp2 = fopen("out.txt", "wb+");
fseek(fp, 0, SEEK_END);
int iLen = ftell(fp);
cout<<"iLen: "<<iLen<<endl;
fseek(fp, 0, SEEK_SET);
fread(buf, 1, iLen, fp);
fwrite(buf, 1, iLen, fp2);
fclose(fp);
fclose(fp2);
return 0;
} ......

C±ê×¼¿â


// Õª×Ô£ºWikipedia.org
CÓïÑԵıê×¼ÎÄÎļþÒªÇóÁËÒ»¸öÆ½Ì¨ÒÆÖ²CÓïÑÔµÄʱºòÖÁÉÙҪʵÏÖµÄһЩ¹¦Äܺͷâ×°µÄ¼¯ºÏ£¬³ÆÎª“±ê×¼¿â”£¬±ê×¼¿âµÄÉùÃ÷Í·²¿Í¨¹ýÔ¤´¦ÀíÆ÷ÃüÁî#include½øÐÐÒýÓá£
ÔÚC89±ê×¼ÖУº
     01. <assert.h>
     02. <ctype.h>
     03. <errno.h>
     04. <float.h>
     05. <limits.h>
     06. <locale.h>
     07. <math.h>
     08. <setjmp.h>
     09. <signal.h>
     10. <stdarg.h>
     11. <stddef.h>
     12. <stdio.h>
     13. <stdlib.h>
     14. <string.h>
     15. <time.h>
ÔÚC95ÄêµÄÐÞÕý°æÖУº
   ......

C ×Ö·û´®º¯Êý´óÈ«

º¯ÊýÃû: stpcpy
¹¦ ÄÜ: ¿½±´Ò»¸ö×Ö·û´®µ½ÁíÒ»¸ö
ÓÃ ·¨: char *stpcpy(char *destin, char *source);
³ÌÐòÀý:
#include <stdio.h>
#include <string.h>
int main(void)
{
   char string[10];
   char *str1 = "abcdefghi";
   stpcpy(string, str1);
   printf("%s\n", string);
   return 0;
}
º¯ÊýÃû: strcat
¹¦ ÄÜ: ×Ö·û´®Æ´½Óº¯Êý
ÓÃ ·¨: char *strcat(char *destin, char *source);
³ÌÐòÀý:
#include <string.h>
#include <stdio.h>
int main(void)
{
   char destination[25];
   char *blank = " ", *c = "C++", *Borland = "Borland";
   strcpy(destination, Borland);
   strcat(destination, blank);
   strcat(destination, c);
   printf("%s\n", destination);
   return 0;
}
º¯ÊýÃû: strchr
¹¦ ÄÜ: ÔÚÒ»¸ö´®ÖвéÕÒ¸ø¶¨×Ö·ûµÄµÚÒ»¸öÆ¥ÅäÖ®´¦\
ÓÃ ·¨: char *strchr(char *str, char c);
³ÌÐòÀý:
#include <string.h>
#include <st ......

C´òÓ¡ ´óÊýµÄ ½×³Ë

 6000ÉõÖÁ10000£¬¶¼¿ÉÒÔ£¬µ«´óÓÚ6000£¬¾Í¿ªÊ¼¹öÆÁÁË¡£¡£
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int main(){
int i,j,*f,tmp,c=0;
long int n,bits;
const double PI=2*asin(1.0),E=exp(1.0);
scanf("%ld",&n);
bits=(long)ceil(n*(log10(n)-log10(E))+log10(2*PI*n)/2);
printf("there are %ld digits\n%ld!=",bits,n);
f=(int*)calloc(bits,sizeof(int));
f[0]=1;
for(i=2;i<=n;i++){
for(j=0;j<bits;j++){
tmp=f[j]*i+c;
c=tmp/10;
f[j]=tmp%10;
} }
for(i=bits-1;i>=0;i--) printf("%d",f[i]);
printf("\n");
return 0;
}
......
×ܼǼÊý:2015; ×ÜÒ³Êý:336; ÿҳ6 Ìõ; Ê×Ò³ ÉÏÒ»Ò³ [166] [167] [168] [169] 170 [171] [172] [173] [174] [175]  ÏÂÒ»Ò³ βҳ
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ