有人能解释一下这些代码语法的确切功能/操作吗? [英] Can someone explain me the exact function/operation of these code syntax(es) ?

查看:95
本文介绍了有人能解释一下这些代码语法的确切功能/操作吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

1。 while(fin.read((char *)& F,sizeof(F))){}

其中fin是文件输入变量(ifstream)



2. fout.write((char *)& F,sizeof(F));

其中fout是文件输出变量(ofstream)



3. fin.getline(ch,20,''' );



4. ch =(char)fin.get();

其中ch是char变量



我尝试过:



理解它们没有描述并直接在代码中应用很难

我很遗憾没有在课程中注意

解决方案

1。阅读一些数据。

2.写一些数据。

3.读一行文字。

4.读一个字符。

1. while(fin.read((char*)&F,sizeof(F))){}
where fin is a file input variable (ifstream)

2. fout.write((char*)&F,sizeof(F));
where fout is a file output variable (ofstream)

3. fin.getline(ch, 20, ' ');

4. ch = (char)fin.get();
where ch is a char variable

What I have tried:

Understanding them without a description and direct application in a code is tough
I regret not paying attention in class

解决方案

1. Read some data.
2. Write some data.
3. Read a single line of text.
4. Read a single character.


这篇关于有人能解释一下这些代码语法的确切功能/操作吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆