Avatar 🍥

Coinidea的博客

Life is random

  1. Home
  2. Archives
  3. Search
  4. 简历
  5. 友情链接
    1. 暗色模式
编程之美

[C++]c++创建txt文件,文件名为输入的字符串,求字节数

Jul 26, 2015
阅读时长: 1 分钟
English
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
#include <iostream>
using namespace std;

int main() {
    char filename[255];
    cin >> filename;

    FILE * pFile = fopen(filename, "r");
    fseek(pFile, 0L, SEEK_END);
    long count = ftell(pFile);  
    cout << "字节数=" << count << endl;
    fclose(pFile);
    return 0;
}
Licensed under CC BY-NC-SA 4.0

相关文章

[leetcode]Number Complement

[leetcode]Print in Order

[leetcode]First Bad Version

[leetcode]Palindrome Linked List

[leetcode]Maximum Product Subarray

© 2020 - 2026 Coinidea的博客
京ICP备15014655号