code001
来源:互联网 发布:h3c 怎么修改端口23 编辑:程序博客网 时间:2024/06/16 13:08
#include <stdio.h>;
#include <stdlib.h>;
struct student_data {
int student_id;
unsigned char marks[10];
};
size_t read_data( FILE *fp, struct student_data *p )
{
return( fread( p, sizeof( struct student_data ), 1, fp ) );
}
int main( void )
{
FILE *fp;
struct student_data std;
int i;
fp = fopen( "/etc/fstab", "r" );
if( fp != NULL ) {
while( read_data( fp, &std ) != 0 ) {
printf( "id=%d ", std.student_id );
for( i = 0; i < 10; i++ ) {
printf( "%3d ", std.marks[ i ] );
}
printf( "\n" );
}
fclose( fp );
return EXIT_SUCCESS;
}
return EXIT_FAILURE;
}
#include <stdlib.h>;
struct student_data {
int student_id;
unsigned char marks[10];
};
size_t read_data( FILE *fp, struct student_data *p )
{
return( fread( p, sizeof( struct student_data ), 1, fp ) );
}
int main( void )
{
FILE *fp;
struct student_data std;
int i;
fp = fopen( "/etc/fstab", "r" );
if( fp != NULL ) {
while( read_data( fp, &std ) != 0 ) {
printf( "id=%d ", std.student_id );
for( i = 0; i < 10; i++ ) {
printf( "%3d ", std.marks[ i ] );
}
printf( "\n" );
}
fclose( fp );
return EXIT_SUCCESS;
}
return EXIT_FAILURE;
}
- code001
- SCU 4315: Sequence
- Windows定义的关于字符串的几种类型
- 内存管理之伙伴系统算法(The Buddy System Algorithm)
- GetLastError,ErrLookUp,$err,hr,$eax
- FS获取KERNEL32基址的三种方法
- code001
- Access2003公司数据库管理综合应用(奋斗的小鸟)_PDF 电子书
- 关于php中自增的问题
- poj2777Count Color(线段树,段更新,段查询用map函数)
- peb获取kernel32基址,用第一和第二种
- Unreal 代码流程分析
- 猎人
- jquerymobile知识点三:弹出层popup
- Github搭建自己的个人blog