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

µÚÒ»¸öpro*C demo

¸Ã³ÌÐòºÜ¼òµ¥£¬¾ÍÊÇÓÃC´ÓORACLE£¬°Ñµ±Ç°ÈÕÆÚÏÔʾ³öÀ´¾ÍOK£¬×÷Ϊһ¸ö¼òµ¥µÄDEMO
£¨Ò»£©Ð´PRO*C
/*===========================================================================
* pro*c±àÒë·½·¨£º
* Ô¤±àÒë proc test.pc
* ±àÒë   gcc -o test test.c $ORACLE_HOME/lib/libclntsh.so
* ×÷Õß   foxliu
* ʱ¼ä   2009-10
*============================================================================*/
#include <stdio.h>
#include <sqlca.h>
int main(int argc,char **argv)
{
     /*ÉùÃ÷SQL±äÁ¿*/
     EXEC SQL BEGIN DECLARE SECTION;
  /*VARCHARÔ¤±àÒëºóΪstruct { unsigned short len; unsigned char arr[20];}*/
     VARCHAR user[20],pass[20],tnsname[20];
    
  char crruentDate[15];
     EXEC SQL END DECLARE SECTION;
    
     /*ÉùÃ÷C±äÁ¿*/
     int i=0;
     
    
     strcpy(user.arr,"dbrevass");
     user.len=strlen((char *)user.arr);
     strcpy(pass.arr,"dbrevass");
     pass.len=strlen((char *)pass.arr);
     strcpy(tnsname.arr,"wapp");
     tnsname.len=strlen((char *)tnsname.arr);
     /*Connect the DB*/
     EXEC SQL CONNECT :user IDENTIFIED BY :pass USING :tnsname;
     /*printf("%d",sqlca.sqlcode);*/
  /*ÓαêÉùÃ÷*/
     EXEC SQL declare emp_cursor cursor for
                                          select sysdate from dual;
            &n


Ïà¹ØÎĵµ£º

ÓÃCÉè¼Æ£¬ÓÃC++±àÂë

ÍøÓѹ۵ã:
(Ò»): 
ÎÒÈÏΪºÜ¶àÈËûÓÐÀí½âlinus»òÕßmyanµÄÒâ˼£¬ÎÒ¾Ù¸öʵÀý¡£
ÎÒÃÇÏÖÔÚÒªÉè¼ÆÒ»Ì×ÍøÂ磭¿Í»§¶ËÈí¼þ£¬ÎÒÃÇÒªÏÈ°ÑЭÒ鶨ºÃ£¬°Ñ½çÃæºÍºǫ́½»»¥Éè¼ÆÏëºÃ£¬°ÑÈÝ´íºÍ»Ö¸´ÏëºÃ£¬ÎÒÈÏΪÕâЩÊÇ×îÖØÒªµÄ£¬ÖÁÓÚ±àÂ룬ÓÃCÒ²¿ÉÒÔ±à³öÀ´£¬ÓÃC£«£«Ò²¿ÉÒÔ±à³öÀ´£¬ÉõÖÁÓÃJAVAÒ²Äܱà³öÀ´£¬¹Ø¼üÊÇÕû¸öÈí¼þµÄ¼Ü¹¹ÒªÇåÎú£¬Õ ......

linux c oci Ô¶³ÌÁ¬½ÓÀý×Ó

ÒÔÏÂÊÇÎҵIJâÊÔociµÄÀý×Ó£¡
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "oci.h"
static OCIServer        *srvhp;
static OCISession       *p_session;
static OCIEnv    &nb ......

Cʱ¼äº¯Êý¼¯ £¨×ªÌù£©

 
 
 CÓïÑԵıê×¼¿âº¯Êý°üÀ¨Ò»ÏµÁÐÈÕÆÚºÍʱ¼ä´¦Àíº¯Êý£¬ËüÃǶ¼ÔÚÍ·ÎļþÖÐ˵Ã÷¡£ÏÂÃæÁгöÁËÕâЩº¯Êý¡£ÔÚÍ·ÎļþÖж¨ÒåÁËÈýÖÖÀàÐÍ£ºtime_t£¬struct tmºÍclock_t¡£
    ÔÚÖÐ˵Ã÷µÄCÓïÑÔʱ¼äº¯Êý               & ......

C/C++ÖÐÖ¸Õë¼Ó 1 µÄÎÊÌâ

 
ÏÈÓñ´¶ûµÄÒ»µÀ±ÊÊÔÌâ¼òÒªµÄ˵Ã÷һϰɣº
¡¾Ì⡿˵Ã÷ÒÔϳÌÐò¡£
#include
int main(void)
{
unsigned int a[3] = {0x01020304, 0x05060708, 0x090a0b0c};
unsigned int *p = (unsigned int *)((int)a +1);¢Ù
printf("%x\n", *p);
return 0;
}
¡¾ÌâÄ¿½âÎö¡¿
Õâ¶Î³ÌÐòµÄÊä³ö½á¹ûÓ¦ ......

CÖеĿɱä²ÎÊýÑо¿

 CÖеĿɱä²ÎÊýÑо¿  
  
  Ò»£®  ºÎν¿É±ä²ÎÊý  
  int   printf(const   char*   format,   ...);    
  ÕâÊÇʹÓùýCÓïÑÔµÄÈËËùÔÙÊìϤ²»¹ýµÄprintfº¯ÊýÔ­ÐÍ£¬ËüµÄ²ÎÊýÖоÍÓй̶¨²ÎÊýformat ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ