zoukankan      html  css  js  c++  java
  • { }之内的代码块在‘{’右边数格处左对齐

    { }之内的代码块在‘{’右边数格处左对齐。

     1 #include <iostream>
     2 #include <process.h>
     3 #include <stdlib.h> 
     4 #include <stdio.h> 
     5 /* run this program using the console pauser or add your own getch, system("pause") or input loop */
     6 using namespace std;
     7 int main(int argc, char** argv) {
     8     FILE *fpd,*fpw;    // 声明FILE结构指针变量 
     9     unsigned char dw;
    10     int i=0;
    11 
    12     //以二进制读方式打开Calc.exe文件
    13     if((fpd=fopen("C:WINDOWSCalc.exe", "rb"))==NULL) 
    14     { 
    15        cout<<"
    Could not open the file."<<endl;
    16        cout<<"Exiting program."<<endl;
    17        exit(1);   //结束程序执行
    18     } 
    19 
    20     // 以二进制写方式打开test.exe文件 
    21     if((fpw=fopen("test.exe", "wb+"))==NULL)
    22     {
    23        cout<<"
    Could not open the file."<<endl;
    24        cout<<"Exiting program."<<endl;
    25        exit(1);   //结束程序执行
    26     }
    27 
    28     // 二进制文件读写操作,每次指定读写1个字节
    29     while(!feof(fpd)) {   //使用feof()判断文件尾 
    30         fread(&dw, 1, 1, fpd);
    31         fwrite(&dw, 1, 1, fpw);
    32     }
    33     // 关闭文件
    34     fclose(fpd);
    35     fclose(fpw);
    36 
    37     //执行Calc.exe和Calc.exe文件
    38     cout<<"1 Run C:WINDOWSCalc.exe"<<endl;
    39     system("C:WINDOWSCalc.exe");
    40     cout<<"-------------------"<<endl;
    41     cout<<"2 Run test.exe!"<<endl;
    42     system("test.exe");
    43     return 0;
    44 }
  • 相关阅读:
    spring配置详解
    表单重复提交解决办法
    Java 两个变量交换值
    spring @ExceptionHandler注解方式实现异常统一处理
    mybatis实战
    使用soapui调用webservice接口
    使用火狐的restclient发送http接口post及get请求
    很多网站301重定向
    邮件发布google blogger 博客
    php file取重复
  • 原文地址:https://www.cnblogs.com/borter/p/9413294.html
Copyright © 2011-2022 走看看