🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: cn.bbs.comp.program
Article #1917

Re: C++���������

#1917
From: ��������ѩ
Date: Wed, 18 Mar 1998 00:00
38 lines
1341 bytes
> ==> Greatchina_Tu(����ү�Ƕ�)                ˵��: 
> �ļ�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]
Technical Details
Message-ID: <980318.yFHi5$PBBS@bbs.ustc.edu.cn>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: Chinese,GB
X-Google-Thread: fc86e,87f17406f99afda5,start
X-Google-Attributes: gidfc86e,public
From: Jiang_Liguo@bbs.ustc.edu.cn (��������ѩ)
Subject: Re: C++���������
Date: 1998/03/18
Message-ID: <980318.yFHi5$PBBS@bbs.ustc.edu.cn>
X-Deja-AN: 335331143
Organization: �й�ƴ�BBSվ
Newsgroups: cn.bbs.comp.program