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 }
  • 相关阅读:
    立则存
    如何在UI控件上绑定一个变量
    欢迎大家使用www.eugene.org.cn访问我的blog
    属性与字段变量的区别
    在C#中联合Excel的Com编程入门
    我和我的土匪奶奶 全集 全 下载 txt
    大菲波数
    Hat's Fibonacci
    Fibonacci 取余,直接做超时
    How Many Fibs? 字符串转换处理
  • 原文地址:https://www.cnblogs.com/borter/p/9413294.html
Copyright © 2011-2022 走看看