场景应用:银行转账时,A给B转账,C给D转账。两者都是调用的connection.begainTransaction();connection.commit();
如何才能保证A,B同在一个线程中,C、D同在一个线程中,且A,BC,D在线程内共享,在线程外独立。...
分类:
编程语言 时间:
2014-06-11 00:29:20
阅读次数:
357
echo
printfprintf命令模仿C程序库(library)里的printf()库程序(library
routine)。它几乎复制了该函数的所有功能。不过在Shell层级的版本上,会有些差异。由于printf的行为是由POSIX标准所定义,因此使用printf的脚本比使用echo移植性好。...
分类:
其他好文 时间:
2014-06-10 10:15:40
阅读次数:
241
6、用双循环打印n行如下图形。 * *** ***** ******* 6 7 8 #include
9 int main() 10 { 11 int i=0,j=0,n=0; 12 13 printf("plz input n\n"); ...
分类:
其他好文 时间:
2014-06-10 09:33:09
阅读次数:
206
在了解回调函数之前,你应该先去了解函数指针!!!
先看一个回调函数的例子:
#include
#include
void Call(void (*fp)(int) ,int x) //Call为调用者,fp为指向回调函数的函数指针
{
fp(x);
}
void CallBackFun1(int x) //CallBackFun1为回调函数
{
printf("回调函数Ca...
分类:
其他好文 时间:
2014-06-10 06:48:19
阅读次数:
171
如果你想学好C#! .把C#当成一门新的语言学习; .看《C#入门经典》和《C#高级编程》;
.不要被VC、BCB、BC、MC、TC等词汇所迷惑——他们都是集成开发环境,而我们要学的是一门语言;
.不要放过任何一个看上去很简单的小编程问题——他们往往并不那么简单,或者可以引伸出很多知识点 .会用Vi...
分类:
其他好文 时间:
2014-06-09 22:13:53
阅读次数:
180
π計算Pi的公式计算Pi的C程序:int
a=10000,b,c=2800,d,e,f[2801],g; main() {for(;b-c;) f[b++]=a/5;for(;d=0,g=c*2;c
-=14,printf("%.4d",e+d/a),e=d%a) for(b=c; d...
分类:
其他好文 时间:
2014-06-09 21:33:15
阅读次数:
202
我的第一个程序!1 #include2 int main()3 {4 printf("Hello
World!\n");5 return 0;6 }
分类:
其他好文 时间:
2014-06-09 14:40:41
阅读次数:
138
#include #include double n,p;int t; int main(){
while(~scanf("%lf%lf",&n,&p)) { t=int (pow(p,1/n) + 0.5);
printf("%d\n",t); } return ...
分类:
其他好文 时间:
2014-06-09 13:54:21
阅读次数:
209
关于+ - ~有意思的一段C代码
问题是钟哥几天前在automation的群里面抛出来的。
code:
#include
int main(int argc,char* argv[])
{
int a = 7;
int b = 1;
printf("before process,a = %d,b = %d\n",a,b);...
分类:
其他好文 时间:
2014-06-08 16:29:03
阅读次数:
215
开发环境 : win7 32bit ,VS2010,先看一段C代码:#include int
main(){ int x; //-858993460 printf("%d",x); //弹出Debug Error对话框 //x=func1();
getchar(); r...
分类:
其他好文 时间:
2014-06-08 06:26:59
阅读次数:
321