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

C++ÖÐʹÓÃsqlite

#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include ".\sqlite3_lib\sqlite3.h"
 
static int _callback_exec(void * notused,int argc, char ** argv, char ** aszColName)
{
    int i;
    for ( i=0; i<argc; i++ )
    {
        printf( "%s = %s\n", aszColName[i], argv[i] == 0 ? "NUL" : argv[i] );
    }
    return 0;
}
void main(int argc,char *argv[])
{
 
const char * sSQL = "select * from animal;";
const char * sSQL1 = "insert into animal(id) values('233');";
    char * pErrMsg = 0;
    int ret = 0;
    sqlite3 * db = 0;
    ret = sqlite3_open("demo.sqb", &db);
    printf("%d\n",ret);
    if ( ret != SQLITE_OK )
    {
        fprintf(stderr, "Could not open database: %s", sqlite3_errmsg(db));
        exit(1);
    }
    printf("Successfully connected to database\n");
    sqlite3_exec( db, sSQL, _callback_exec, 0, &pErrMsg );
    if ( ret != SQLITE_OK )
    {
   
  fprintf(stderr, "SQL error: %s\n", pErrMsg);
        sqlite3_free(pErrMsg);
    }
    sqlite3_exec( db, sSQL1, _callback_exec, 0, &pErrMsg );
    if ( ret != SQLITE_OK )
    {
   
  fprintf(stderr, "SQL error: %s\n", pErrMsg);
        sqlite3_free(pErrMsg);
    }
    sqlite3_exec( db, sSQL, _callback_exec, 0, &pErrMsg );
    if ( ret != SQLITE_OK )
    {
   
  fprintf(stderr, "SQL error: %s\n", pErrMsg)


Ïà¹ØÎĵµ£º

C++ÖÐextern ¡°C¡±º¬ÒåÉî²ã̽Ë÷

1.ÒýÑÔ
¡¡¡¡C++ÓïÑԵĴ´½¨³õÖÔÊÇ“a better C”£¬µ«ÊÇÕâ²¢²»Òâζ×ÅC++ÖÐÀàËÆCÓïÑÔµÄÈ«¾Ö±äÁ¿ºÍº¯ÊýËù²ÉÓõıàÒëºÍÁ¬½Ó·½Ê½ÓëCÓïÑÔÍêÈ«Ïàͬ¡£×÷ΪһÖÖÓûÓëC¼æÈݵÄÓïÑÔ£¬C++±£ÁôÁËÒ»²¿·Ö¹ý³ÌʽÓïÑÔµÄÌص㣨±»ÊÀÈ˳ÆΪ“²»³¹µ×µØÃæÏò¶ÔÏ󔣩£¬Òò¶øËü¿ÉÒÔ¶¨Òå²»ÊôÓÚÈκÎÀàµÄÈ«¾Ö±äÁ¿ºÍº¯Êý¡£µ«ÊÇ£¬C++±Ï¾ ......

½«Win32 C/C++Ó¦ÓóÌÐòǨÒƵ½Linux

±¾ÎĵÄÄÚÈÝÊÇ Win32 API£¨ÌرðÊǽø³Ì¡¢Ï̺߳͹²ÏíÄÚ´æ·þÎñ£©µ½ POWER ÉÏ Linux µÄÓ³Éä¡£±¾ÎÄ¿ÉÒÔ°ïÖúÄúÈ·¶¨ÄÄÖÖÓ³Éä·þÎñ×îÊʺÏÄúµÄÐèÒª¡£×÷ÕßÏòÄúÏêϸ½éÉÜÁËËûÔÚÒÆÖ² Win32 C/C++ Ó¦ÓóÌÐòʱÓöµ½µÄ API Ó³Éä¡£
¸ÅÊö
Óкܶ෽ʽ¿ÉÒÔ½« Win32 C/C++ Ó¦ÓóÌÐòÒÆÖ²ºÍǨÒƵ½ pSeries ƽ̨¡£Äú¿ÉÒÔʹÓÃÃâ·ÑÈí¼þ»òÕßµÚÈý·½¹¤¾ßÀ´ ......

C/C++Öеĺ¯Êý²ÎÊý´«µÝ»úÖÆ(תÔØ)

 Ò»¡¢ º¯Êý²ÎÊý´«µÝ»úÖƵĻù±¾ÀíÂÛ ¡¡¡¡º¯Êý²ÎÊý´«µÝ»úÖÆÎÊÌâÔÚ±¾ÖÊÉÏÊǵ÷Óú¯Êý£¨¹ý³Ì£©ºÍ±»µ÷Óú¯Êý£¨¹ý³Ì£©ÔÚµ÷Ó÷¢Éúʱ½øÐÐͨÐŵķ½·¨ÎÊÌâ¡£»ù±¾µÄ²ÎÊý´«µÝ»úÖÆÓÐÁ½ÖÖ£ºÖµ´«µÝºÍÒýÓô«µÝ¡£ÒÔÏÂÌÖÂ۳Ƶ÷ÓÃÆäËûº¯ÊýµÄº¯ÊýΪÖ÷µ÷º¯Êý£¬±»µ÷Óõĺ¯ÊýΪ±»µ÷º¯Êý¡£¡¡¡¡Öµ´«µÝ£¨passl-by-value£©¹ý³ÌÖУ¬±»µ÷º¯ÊýµÄÐÎʽ²Î ......

VB/C++/C#´®¿ÚͨѶԴ´úÂ롾¸½ÏêϸעÊÍ¡¿


VB
    If MSComm1.PortOpen = True Then MSComm1.PortOpen = False
    MSComm1.CommPort = i1
    MSComm1.PortOpen = True
    MSComm1.InputMode = comInputModeBinary
    MSComm1.InBufferCount = 0
& ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ