码迷,mamicode.com
首页 > 其他好文 > 详细

字符串连接,数字tostring,写入文件

时间:2016-06-20 15:48:12      阅读:146      评论:0      收藏:0      [点我收藏+]

标签:

技术分享

 

 

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[])
{
    int x=2410;
    int i;
    char *str="http://www.wrxqh.com/applyTicketInfo/showRegInfo.action?id=";
    FILE *myfile = fopen("list.text","w+");
    for (i=0; i<=1253; i++)
    {
        fprintf(myfile,"%s",str);
        fprintf(myfile,"%d",x);
        fprintf(myfile,"%s","\n");//换行 
        x++;
    }
    fclose(myfile);
    return 0;
}

  

 

字符串连接,数字tostring,写入文件

标签:

原文地址:http://www.cnblogs.com/jhcla/p/5600364.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!