Re: file size limit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux