Pro*C ²¢·¢Êý¾Ý¿âÁ¬½Ó¡¢½¨Á¢Êý¾Ý¿âÁ´
/*
* ¸Ã¹¦ÄÜÖ÷ÒªÊÇÑÝʾ£¬Í¬Ê±Á¬½ÓÁ½¸ö²¢·¢µÄÊý¾Ý¿â
*/
/* °üº¬CÍ·Îļþ */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
/* °üº¬SQLCAÍ·Îļþ */
EXEC SQL INCLUDE sqlca;
EXEC SQL INCLUDE sqlda;
int main()
{
EXEC SQL BEGIN DECLARE SECTION;
int money;
char answerbuff[200];
int flag;
EXEC SQL END DECLARE SECTION;
/*
* ¶¨ÒåÊäÈëËÞÖ÷±äÁ¿:½ÓÊÕÓû§Ãû¡¢¿ÚÁîºÍÍøÂç·þÎñÃû
*
*/
char username[10],password[10],server[10], conn_var[20];
strcpy(username,"data_center");
strcpy(password,"data_center");
strcpy(server,"oradf1"); /*ÕâÀïÌîдµÄÊÇÊý¾Ý¿âµÄSID*/
strcpy(conn_var,"llcore");
/* Á¬½Óµ½Ä¬ÈÏÊý¾Ý¿â */
EXEC SQL CONNECT :username IDENTIFIED BY :password USING :server;
if (sqlca.sqlcode==0)
printf("ĬÈÏÁ¬½Ó³É¹¦!\n");
else
/* ÏÔʾÁ¬½Ó´íÎóÏûÏ¢ */
printf("%.*s\n", sqlca.sqlerrm.sqlerrml,
sqlca.sqlerrm.sqlerrmc);
/*¶Ï¿ªÊý¾Ý¿âÁ¬½Ó*/
EXEC SQL COMMIT RELEASE;
printf("¶Ï¿ªÁ¬½Ó!\n");;
/* Á¬½Óµ½·ÇĬÈÏÊý¾Ý¿â */
/*ÕâÀïÓÐÁ½ÖÖÁ¬½Ó·½Ê½£¬Ö»È¡Ò»ÖÖºÍĬÈϵķ½Ê½±£³ÖÒ»Ö´Ç*/
EXEC SQL CONNECT :username IDENTIFIED BY :password AT:conn_var USING :server;
if (sqlca.sqlcode==0)
printf("·ÇĬÈÏÁ¬½Ó³É¹¦!\n");
else
&
Ïà¹ØÎĵµ£º
//#include "stdafx.h"
/*
ÃèÊö:´¿cÄ£ÄâÀà,´¿c±àдc++Àà,´¿cʵÏÖc++ÀàµÄ¼òµ¥·¶Àý,½á¹¹Ä£ÄâÀà,struct ±àдclass.
c±àдÀàÊÇʵÏÖ´¿c±àдcom×é¼þµÄ»ù´¡¡£
*/
#include <stdio.h>
typedef struct _Vtbl
{
void (*AddRef)(struct CObject* obj,int);//ËùÓеĺ¯ÊýµÄµÚÒ»¸ö²ÎÊýÀàËÆclassµÄÒþÄäµÄ ......
http://www.ddj.com/cpp/221600722
Q: HOW DO I... put timers with default actions in my C code?
A: Many times, we need to write programs that will only wait a certain specified amount of time for a user to do something. After that time, we need to assume that the user isn't going to do anything and ......
×óÖµÐÔ£¨lvalueness£©ÔÚC/C++ÖÐÊDZí´ïʽµÄÒ»¸öÖØÒªÊôÐÔ¡£Ö»ÓÐͨ¹ýÒ»¸ö×óÖµ±í´ïʽ²ÅÄÜÀ´ÒýÓü°¸ü¸ÄÒ»¸ö¶ÔÏó£¨object£©µÄÖµ¡££¨Ä³Ð©Çé¿öÏ£¬ÓÒÖµ±í´ïʽҲÄÜÒýÓã¨refer£©µ½Ä³Ò»¸ö¶ÔÏ󣬲¢ÇÒ¿ÉÄܼä½ÓÐ޸ĸöÔÏóµÄÖµ£¬ºóÊö£©¡£
ºÎν¶ÔÏó£¿Èç¹ûûÓÐÃ÷ȷ˵Ã÷£¬ÕâÀï˵µÄ¶ÔÏ󣬺ÍÏÁÒåµÄÀà/¶ÔÏó£¨class/object£© ......
1¡¢´ÓN¸öÊýÖÐÑ¡³ön¸ö×î´óµÄÊý£¬Ð´³ö˼·ºÍʵÏÖ¡£
¡¶±à³ÌÖ®ÃÀ¡·ÉÏÓн²Õâ¸öËã·¨µÄÉè¼ÆÓë˼·¡£
ÎÒÕâÀï¼òµ¥Ð´¼¸¸ö˼·£º
£¨a£©Èç¹ûNÄÜÔÚÖ÷´æÖÐÒ»´Î¶ÁÈ룬ÔòÏȽøÐпìÅÅ£¬È»ºóÔÙȡǰn¸öÊý¡£Ëã·¨¸´ÔÓ¶È£ºO(NlogN).
£¨b£©Èç¹ûN·Ç³£´ó£¬¼ÙÉè²»ÄÜÒ»´Î¶ÁÈëÄڴ棬²¢ÇÒn²»ÊǺܴóµÄ»°£¬¿ÉÒÔά»¤Ò»¸ön¸öÔªËØµÄÓÐÐò¶ÓÁУ¬¶ÓÁÐÖж¼ÊÇÿ¸ ......
ÔÚVC6ÖÐʹÓÃc API·½Ê½Á¬½ÓMySQLÊý¾Ý¿â
Ò»¡¢»·¾³ÅäÖÃ
1¡¢ÔÚMySqlµÄ¹Ù·½ÍøÕ¾ÏÂÔØmysql-connector-c-noinstall£¬²¢½«½âѹºóµÄbinºÍincludeÎļþ¼Ð¿½±´µ½MysqlµÄ°²×°Ä¿Â¼
2¡¢ÉèÖÃVC6»·¾³£¬ÔÚvc¹¤¾ß-Ñ¡Ïî-Ŀ¼£¬¼ÓÈë¸Õ²ÅµÄIncludeÎļþ¼ÐµÄ·¾¶£¬ÀýÈ磺C:\Program Files\MySQL\MySQL Server 5.1\include
¶þ¡¢¹¤³ÌÉèÖÃ
3¡¢½«li ......