C++ Read Data from File into Struct
来源:互联网 发布:vs for mac 下载 编辑:程序博客网 时间:2024/05/10 18:08
#include <iostream>#include <string>#include <fstream>using namespace std;#define N 2struct Student{ string name; int age;};int main(){ struct Student stu[N]; ifstream fin("text.txt"); if(!fin){ cout<<"File open error!\n"; return 1; } for(int i = 0; i < N; i++) { fin >> stu[i].name; fin >> stu[i].age; } for(i = 0; i < N; i++) { cout<<stu[i].name<<" "<<stu[i].age<<endl; } fin.close(); return 0;}
- C++ Read Data from File into Struct
- Read & Return Data From Files Into PHP
- Read pixel data from bitmap file
- How to read data from a file in reverse order?
- How to read data from csv file in c#
- read numbers from file and exchange their positions then write into another file
- Configure file like format of ini and read data from ini file or write data to ini file
- Matlab read data from txt file and then cluster data using K-means
- ORA-01187: cannot read from file because it failed verification tests ORA-01110: data file 201: '/
- How To Load CLOB Data from a File into a CLOB column using PL/SQL
- pandas read data from files
- Read a file from xml
- Read and Display Data From an Excel File (.xsl or .xlsx) in ASP.NET
- Read file from inside a JAR file
- Unable to read TLD "META-INF/c.tld" from JAR file "file: 解决办法
- mysql select / insert into / from file
- Upload Excel File Data into Internal Table
- argparse load data from file
- 统计过程表里千万别出现null值,这…
- IT游医的博客大全
- 高效调试shell脚本的技巧
- 深入浅出MFC笔记(1)
- 活着的意义--读《此生未完成》有感
- C++ Read Data from File into Struct
- 关联两表的update
- 判断绝对素数
- sql存储过程(1)
- Win7下的快捷键
- 关于try-catch-finally中的一点心得
- sql存储过程(2)
- c++ 字符串分割成数组
- JavaScript实现页面跳转的几种方式