Thread View: cn.bbs.comp.program
1 messages
1 total messages
Started by ��������ѩ
Wed, 18 Mar 1998 00:00
Re: C++���������
Author: ��������ѩ
Date: Wed, 18 Mar 1998 00:00
Date: Wed, 18 Mar 1998 00:00
38 lines
1341 bytes
1341 bytes
> [1;36m==> Greatchina_Tu(����ү�Ƕ�) ˵��: [37;40m[0m
> �ļ�test.dat��СΪ1024*768=786432�ֽڡ�
> Ϊ��������һ�γ����һ����˳���
> #include<dos.h>
> #include<iostream.h>
> #include<fstream.h>
> void main(void)
> {
> int i;
> char *buffer;
> ifstream in("test.dat");
> if(!in)
> {
> cout<<"\nCan't open the file!\n";
> return;
> }
> if(!(buffer=new char[1024])){
> cout<<"\nNo Enough Memory!\n";
> return;}
> for(i=0;i<768;i++)
> {
> in.read(buffer,1024);
> if(in.gcount()!=1024)
> {
> cout<<"\nReading imagedata error.\n";
> return;
> }
> }
> in.close();
> delete buffer;
> }
���ķ�ʽ(text or binary)��ȷָ��Ϊ��, ȱʡ�ĺ�����text��ʽ, ����
Ӧ��binary��ʽ��.
--
�� ��Դ: �й�ƴ�BBSվ [bbs.ustc.edu.cn]
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads