二四六免费资料大全:

- “ϵԒ - - У· - VӅ^ɽ·A@^3307(AT)
Fڵλã ӋCӖ >> Ӗ̳ >> CZ >> 
c++֪RСY֮ݔcݔ ߣӋC࡭    ̳́ԴVӋCӖ    c    •rg2010-12-2

ϴȫ www.wzfng.com    ifstreamofstreamfstream@Щxژ˜ʎļfstream.hԷPļIJҪڳʹã#include<fstream.h>Z԰M@ļݔҪע

1IPݔ딵Ăͼccine׃һһ2cin܌ݔĿո܇Ixoַ׃ҪяIPݔÿһַxo׃ʹúcin.get()ʽ飺cin.get(ַ׃)ַ׃=cin.get()ҲԞcin.get(str,100,'a')

 (3)YݔrݔеēQз\nYַԄӁGݔ´ݔĵһַԽóɆTignore()G@ַÁݔ

 

ʮMưMƔݔݔhexʾʮMoctʾMdecʾʮMcin>>hex>>i;cin>>oct>>j;cin>>dec>>m;

ֵע

1MƻʮMƔݔֻm׃

2cinָʹõĔݔtָĔһֱЧֱָݔ딵ݔcݔͬݔrҪָݔ헵Čcout.width(5);cout<<setw(6)<<i<<set(10)<<j;

   (setwָo헵ݔ,ҌR)tڳ_ʼλñ횰^ļiomainip.hƌWʾݔcout.setf(ios::scientific);cout<<x<<'\n';(x錍);OҌRcout.setf(ios::left)cout.setf(ios::right);OݔЧλʹcout.precision(3)c++IJٿvsetprecision()^˕rҪڳаļiomanip.h磺cout<<setprecision(3)Oݔַ1ʹiosijɆTfill()磺cout.fill('*'),2ʹc++ٿvsetfill(),˕rҪڳаļiomanip.h,磺cout<<stefill('#')?ʹúcin.getline(char *s,int length)팍FַݔݔLСlengthrHݔַͽos,ݔַLȴlengthrֻȡlengthַͽosԄӼӡ\0istreamijɆTreadԏݔxȡַָcin.read(str,5)

   ݔput()ݔһַںķ͞ostreamČԿԴ“ʹ,磺cout.put('y').put('e').('s');write()ݔһָLȵַ磺cout.write(str,3)

   ļĴ_ʽЃɷN

1{ļĘ캯  ļűPļ_ʽifstream  infile("a.txt",ios::binary)ڮǰĿ䛴_һMļ,ofstream outfile("b.txt")ڮǰĿ䛴_һıļ;

2{ļɆTopen()ļ.open("űPļ"_ʽ)磺ifstream inflie; infile.open("a.dat",ios::binary)

  ɷNĽYһӵļ_ɹtļ0ֵt0ôˁДļIJǷɹP]ļļ.close()inflie.close()ДļǷYһļɆTeof()infile.eof(),Yط0ֵt0Дݔ_ʽķֵinfile>>a[i]infile.get(),ļY0ֵtط0ֵMļIJxMļijɆTread()ļread((char *)ȴַxֹ)磺int a[40];infile.read((char *)a,40);ݔMļɆTwrieļ.write((char *)ȴַݔֹ)磺int a[10]={0,1,2,3,4,5,6,7,8,9};outfile.write((char *)a,5*sizeof(int))?ļք뺯Iļ?seekg(<ƫ>,<λ>)ļָᘵĺʽ飺ļ.seekp(<ƫ>,<λ>)λֻios::beg//ļ^,ios::cur//ǰλ,ios::end()//ļYβ֮һcļָPĺgcount()//һݔxֹtellg()//ݔļָᘵĮǰλtellp()//ݔļָᘵĮǰλ

WУ· |Wվ؈D| ϴȫ Copyright 2006-2016 All Rights Reserved VϢԃ޹˾ 䰸/SC̖ICP11070650̖-9 B̩˱BϢg޹˾VӋCWУӖW ٷWַϴȫ www.wzfng.com ˾ַVӅ^ɽ·AWƼ@A@^3307AT