linux c++Á¬½ÓmysqlʾÀý
¡¡±àÒëºÍÁ¬½Ó³ÌÐò
¡¡¡¡MySQLÖÐÓÐÒ»¸öÌØÊâµÄ½Å±¾,½Ð×ömysql_config. Ëü»áΪÄã±àÒëMySQL¿Í»§¶Ë,²¢Á¬½Óµ½MySQL·þÎñÆ÷ÌṩÓÐÓõÄÐÅÏ¢.ÄãÐèҪʹÓÃÏÂÃæÁ½¸öÑ¡Ïî.
¡¡¡¡1. --libs Ñ¡Ïî - Á¬½ÓMySQL¿Í»§¶Ëº¯Êý¿âËùÐèÒªµÄ¿âºÍÑ¡Ïî.
¡¡¡¡$ mysql_config --libs
¡¡¡¡2. --cflags Ñ¡Ïî - ʹÓñØÒªµÄincludeÎļþµÄÑ¡ÏîµÈµÈ.
¡¡¡¡$ mysql_config --cflags
¡¡¡¡ÄãÐèÒª½«ÉÏÃæÁ½¸öÑ¡Ïî¼ÓÈëµ½¶ÔÔ´ÎļþµÄ±àÒëÃüÁîÖÐ. ËùÒÔ,Òª±àÒëÉÏÃæµÄ³ÌÐò,ҪʹÓÃÏÂÃæµÄÃüÁî:
¡¡¡¡$ g++ -o output-file $(mysql_config --cflags) test.c $(mysql_config --libs)
¡¡¡¡Ö´ÐбàÒëºóµÄ³ÌÐò:
¡¡¡¡$ ./output.file
#include <mysql.h>
#include <stdlib.h>
#include <stdio.h>
static char *server_args[] =
{
"this_program", /* this string is not used */
"--datadir=.",
"--key_buffer_size=32M"
};
static char *server_groups[] =
{
"embedded",
"server",
"this_program_SERVER",
(char *)NULL
};
int main(void)
{
if (mysql_server_init(sizeof(server_args) / sizeof(char *),
server_args, server_groups))
exit(1);
MYSQL *conn;
MYSQL_RES *res;
MYSQL_ROW row;
char *server = "localhost";
char *user = "admin";
char *password = "metrics"; /* ´Ë´¦¸Ä³ÉÄãµÄÃÜÂë */
char *database = "test";
conn = mysql_init(NULL);
/* Connect to database */
if (!mysql_real_connect(conn, server,
user, password, database, 0, NULL, 0))
{
fprintf(stderr, "%s\n", mysql_error(conn));
exit(1);
}
/* send SQL query */
if (mysql_query(conn, "show tables"))
{
fprintf(stderr, "%s\n", mysql_error(conn));
exit(1);
}
res = mysql_use_result(conn);
//utput table name */
printf("MySQL Tables in mysql database:\n");
while ((row = mysql_fetch_row(res)) != NULL)
printf("%s \n", row[0]);
Ïà¹ØÎĵµ£º
£¨L2CAPÐÒé¼ò½é£¬L2CAPÔÚBlueZÖеÄʵÏÖÒÔ¼°L2CAP±à³Ì½Ó¿Ú£©
Ò»£ºL2CAPÐÒé¼ò½é£º
Logical Link Control and Adaptation Protocol(L2CAP)
Âß¼Á¬½Ó¿ØÖƺÍÊÊÅäÐÒé (L2CAP) ΪÉϲãÐÒéÌṩÃæÏòÁ¬½ÓºÍÎÞÁ¬½ÓµÄÊý¾Ý·þÎñ£¬²¢Ìṩ¶àÐÒ鹦ÄܺͷָîÖØ×é²Ù×÷¡£L2CAP ³äÐíÉϲãÐÒéºÍÓ¦ÓÃÈí¼þ´«ÊäºÍ½ÓÊÕ×î´ó³¤¶ÈΪ 64K µÄ L2CAP Ê ......
C³ÌÐòÊÇÓÉÒ»×é»òÊDZäÁ¿»òÊǺ¯ÊýµÄÍⲿ¶ÔÏó×é³ÉµÄ¡£ º¯ÊýÊÇÒ»¸ö×ÔÎÒ°üº¬µÄÍê³ÉÒ»¶¨Ïà¹Ø¹¦ÄܵÄÖ´ÐдúÂë¶Î¡£ÏÂÃæС±àºÍ´ó¼Ò·ÖÏíÏÂCÓïÑÔÖеĺ¯Êý¡£
1. setallpalletteº¯Êý
setallpalletteº¯ÊýµÄ¹¦ÄÜÊÇ°´Ö¸¶¨·½Ê½¸Ä±äËùÓеĵ÷É«°åÑÕÉ«£¬ÆäÓ÷¨Îª£ºvoid far setallpallette(struct palette, fa ......
Ðí¶à±à³ÌÓïÑÔÖеĵ÷Óú¯ÊýµÄÁ½ÖÖ·½·¨ÊÇ°´Öµµ÷ÓÃ(call-by-value)ºÍ°´ÒýÓõ÷ÓÃ(call-by-reference)¡£
²ÎÊý°´Öµµ÷Óô«µÝʱ£¬Éú³É²ÎÊýÖµ¸±±¾²¢ÇÒ´«¸ø±»µ÷Óú¯Êý£¬¸±±¾µÄ¸Ä±ä²¢²»Ó°Ïìµ÷ÓÃÕßµÄÔʼ±äÁ¿Öµ£¬ÕâÑù¾Í¿ÉÒÔ·ÀÖ¹ÒâÍâµÄ¸±×÷ÓÃÓ°Ï쿪·¢ÕýÈ·£¬¿É¿¿µÄϵͳ¡£°´Öµµ÷ÓõÄÒ»¸öȱµãÊÇ£¬Èç¹û´«µÝ½Ï´óµÄÊý¾ÝÏÔò¸´ÖÆÕâ¸öÊý ......
ÔÚlinux
ÏÂдns´úÂëÒÔ¼°tcl²âÊԽű¾£¬¹Û²ìtraceÎļþµÈ¶¼ÉÙ²»ÁËÓÃvim¡£vimÊÇÒ»¸ö¸ßЧµÄä¯ÀÀ¹¤¾ß¡£ÓкܶàʹÓü¼ÇÉ£¬ÔÚ´Ë£¬×ªÔØÒ»¸öÓ÷¨¼ò½é¡£
£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½
ÏÈÉÔΪ½éÉÜһϠvim. vi ÊÇ unix/linux
ϼ«ÎªÆÕ±éµÄÒ»ÖÖÎı¾±à¼Æ÷, ´ó²¿·Ö»ú ......