| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1501 人关注过本帖
标题:[求助]请问c程序可以做成独立于tc环境的可执行文件吗?
取消只看楼主 加入收藏
忧郁的风
Rank: 1
等 级:新手上路
帖 子:65
专家分:0
注 册:2004-11-1
收藏
 问题点数:0 回复次数:3 
[求助]请问c程序可以做成独立于tc环境的可执行文件吗?
小弟最近做了个小程序,想把它做成可独立于tc环境的可执行文件或是作成一个安装文件,但不知道怎么做,哪位高手知道的话请指点一二,小弟不胜感激!
搜索更多相关主题的帖子: 环境 文件 
2005-04-07 17:11
忧郁的风
Rank: 1
等 级:新手上路
帖 子:65
专家分:0
注 册:2004-11-1
收藏
得分:0 
但我试过将.exe文件复制到tc外执行,但好想不行.
请问有其他办法吗?

轻轻的我走了,正如我轻轻的来,轻轻的我挥一挥衣袖,轻轻的抹去我留下的痕迹------风过无痕
2005-04-11 17:13
忧郁的风
Rank: 1
等 级:新手上路
帖 子:65
专家分:0
注 册:2004-11-1
收藏
得分:0 

就是这个程序了 是个时钟程序,画出一个钟表,调用系统当前时间,使钟表与系统时间同步,并在钟表下面显示当前时间 #include <graphics.h> #include <time.h> #include <stdio.h> #include <math.h> #include <stdlib.h> #include <conio.h> #include <dos.h>

main() { void minutepoint(int,int,int); void pointer(int x,int y,int r); void watchface(int,int,int); void drawcircle(int,int,int,int);

int gdriver=DETECT,gmode,errorcode; int x,y,r=60;

initgraph(&gdriver,&gmode,"");/*initialize the graph*/ errorcode=graphresult(); if(errorcode!=grOk) /*the graph initialization failed*/ { printf("Graphics error:%s\n",grapherrormsg(errorcode)); printf("Press any key to terminate the program......"); getch(); exit(1); } /*end if*/

x=getmaxx()/2; /*set the x coordinate of the circle*/ y=getmaxy()/2; /*set the y coordinate of the circle*/

setbkcolor(LIGHTGRAY); /* set the backgroud color*/

setcolor(YELLOW); outtextxy(x-r-30,y+r+50,"press any key to quit......"); watchface(x,y,r); pointer(x,y,r); } /*end main*/

void drawcircle(int x,int y,int r,int color) { setcolor(color); /*set the circle's color*/ circle(x,y,r); setfillstyle(1,color); floodfill(x,y,color); } /*end drawcircle*/

/*the following function is to draw the hour graduations*/ void hourpoint(int x,int y,int r) { int r0=r-10,i; /*r-r0 is the length of the hour graduations*/ double PI=3.1415927; double temp1=0,temp2=0;

for(i=0;i<12;i++) { temp1=cos(i*PI/6); temp2=sin(i*PI/6);

/*draw the hour graduations*/ line(x+floor(r*temp1),y-floor(r*temp2),x+floor(r0*temp1),y-floor(r0*temp2)); } /*end for*/ } /*end hourpoint*/

/*the following functiong is to draw the minute graduations*/ void minutepoint(int x,int y,int r) { int r0=r-5,i; /*r-r0 is the length of the minute graduations*/ double PI=3.1415927,temp1,temp2;

for(i=0;i<60;i++) if(i%5!=0) { temp1=cos(i*PI/30); temp2=sin(i*PI/30);

/*draw the minute graduations*/ line(x+floor(r*temp1),y-floor(r*temp2),x+floor(r0*temp1),y-floor(r0*temp2)); } /*end if*/ } /*end minutepoint*/

/*the following function is to draw the face of the clock*/ void watchface(int x,int y,int r) { drawcircle(x,y,r+10,YELLOW); drawcircle(x,y,r,LIGHTBLUE);

setcolor(YELLOW); /*set color of the hour graduations and the minute graduations*/

hourpoint(x,y,r); minutepoint(x,y,r); } /*end watchface*/

/*the following function is to draw the hourpointer,minutepointer,secondpointer*/ void pointer(int x,int y,int r) { /*len is the secondpointer's length*/ /*mlen is the minutepointer's length*/ /*hlen is the hourpointer's length*/ /*counter is to count the current minute, the hourpointer will move forward a graduation every 12 minutes*/

int len=r-15,mlen=r-30,hlen=r-45,i,j,k,counter=0; double PI=3.1415927; struct time t,t1,t2; time_t t0; int *buffer1,size1;

/*apply space to store the image of current time*/ time(&t0); size1=imagesize(x-r-30,y+r+30,x-r+strlen(ctime(&t0)),y+r+40); buffer1=(int *) malloc (size1); if(!buffer1) { printf("Can't apply spaces to store the image!\n"); printf("Press any key to terminate the program......"); getch(); } /*end if*/

settextstyle(0,0,1);/*set the text property*/

gettime(&t); counter=t.ti_min/12; /*calculate current minute is how many times of 12*/ k=(t.ti_hour%12)*5+counter;/*set the hourpointer's initial position*/

for(;;) /*the circulation of the hourpointer*/ for(j=t.ti_min;j<t.ti_min+60;) /*the circulation of the minutepointer*/ { if(t.ti_min%12==0) /*redraw the hour pointer*/ { setcolor(LIGHTBLUE); line(x,y,x+floor(hlen*cos(k*PI/30)),y-floor(hlen*sin(k*PI/30))); setcolor(YELLOW); line(x,y,x+floor(hlen*cos(k*PI/30)),y-floor(hlen*sin(++k*PI/30))); } /*end if*/ for(i=t.ti_sec;i<t.ti_sec+60;)/*the circulation of the secondpointer*/ { gettime(&t1); while(1) { if(kbhit()) exit(0);/*press any key to exit*/ gettime(&t2); if(t2.ti_sec-t1.ti_sec==1||t2.ti_sec-t1.ti_sec==-59) break; } /*end while*/

/*draw the minutepointer*/ line(x,y,x+floor(mlen*cos((15-j)*PI/30)),y-floor(mlen*sin((15-j)*PI/30)));

if(t2.ti_sec-t1.ti_sec==-59) /*redraw the minute pointer every 60 seconds*/ { setcolor(LIGHTBLUE); line(x,y,x+floor(mlen*cos((15-j)*PI/30)),y-floor(mlen*sin((15-j)*PI/30))); setcolor(YELLOW); line(x,y,x+floor(mlen*cos((15-j)*PI/30)),y-floor(mlen*sin((15-++j)*PI/30))); } /*end if*/

/*redraw the hourpointer*/ line(x,y,x+floor(hlen*cos((15-k)*PI/30)),y-floor(hlen*sin((15-k)*PI/30)));

/*redraw the secondpointer*/ setcolor(LIGHTBLUE); line(x,y,x+floor(len*cos((15-i)*PI/30)),y-floor(len*sin((15-i)*PI/30))); setcolor(YELLOW); line(x,y,x+floor(len*cos((15-i)*PI/30)),y-floor(len*sin((15-++i)*PI/30)));

/*show the current time in text form*/ putimage(x-r-30,y+r+30,buffer1,1);/*put the current time*/ time(&t0);/*get the current time*/ outtextxy(x-r-30,y+r+30,ctime(&t0)); /*get image of the current time*/ getimage(x-r-30,y+r+30,x-r-30+size1,y+r+40,buffer1); } /*end for*/ } /*end for*/ } /*end pointer*/ 


轻轻的我走了,正如我轻轻的来,轻轻的我挥一挥衣袖,轻轻的抹去我留下的痕迹------风过无痕
2005-04-11 17:45
忧郁的风
Rank: 1
等 级:新手上路
帖 子:65
专家分:0
注 册:2004-11-1
收藏
得分:0 
楼上的能不能把详细的情况发我的邮箱里?
bobby200105@
先谢过了!

轻轻的我走了,正如我轻轻的来,轻轻的我挥一挥衣袖,轻轻的抹去我留下的痕迹------风过无痕
2005-04-12 15:27
快速回复:[求助]请问c程序可以做成独立于tc环境的可执行文件吗?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.013279 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved