From: Nathan Newsgroups: comp.os.msdos.djgpp Subject: Re: DJGPP: seekg 16/8bit problem!!! CODE C++ Date: Thu, 13 Jan 2000 11:34:33 +0000 Organization: University College London Lines: 142 Message-ID: <387DB849.986184E@ucl.ac.uk> References: <387C4E01 DOT 112479F3 AT ucl DOT ac DOT uk> <85iad1$eu3$2 AT antares DOT lu DOT erisoft DOT se> NNTP-Posting-Host: psaurus.anat.ucl.ac.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: uns-a.ucl.ac.uk 947762874 17916 128.40.53.42 (13 Jan 2000 11:27:54 GMT) X-Complaints-To: usenet AT ucl DOT ac DOT uk NNTP-Posting-Date: 13 Jan 2000 11:27:54 GMT X-Mailer: Mozilla 4.7 [en] (Win98; I) X-Accept-Language: en To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com No, this works like gibberish, nathan // program for working out file size #include #include #include #include long image=0, matrix_r=0, matrix_c=0, depth=0, i=0; char if_name[80], of_name[80]; // declare variables void main(int argc, char **argv) { // check for input error cout << "number of rows:"; cin >> matrix_r; cout << "number of columns:"; cin >> matrix_c; cout << "pixel depth (8 or 16):"; cin >> depth; cout << "output name:"; cin >> of_name; // input variables if (!of_name) { cout << "File output not specified" << endl; exit (-1); } if (depth!=8 && depth!=16) { cout << "wrong depth value, try 8 or 16" << endl; exit (-1); } // error checking ofstream output(of_name, ios::binary | ios::out ); if (!output) { cout << "couldn't open file" << endl; exit (-1); } // open output and check for errors for (i=1; i