This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: file size limit


Here is the sample code:

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stddef.h>
#include <ostream>
#include <iostream>
#include <fstream>
using namespace std;

int main(int argc, char *argv[])
{
   char *filename;
   fstream filein;

   setbuf(stdout,NULL);
   filename = argv[1];
   filein.open(filename,fstream::in);
   if (filein == NULL)
   {
	   printf("Error opening %s\n",filename);
	   exit(2);
   } else {
	   printf("File opened correctly %s\n",filename);
   }
   return 0;
}

Compile command: make
Here is the compile output:
g++32 -w -g  -c test.cpp
g++32 -w -g -o test test.o

This is the command: ./test test.out
Output: Error opening test.out

Thanks,
Cristian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]