Hi all,

I'm a beginner at Open Watcom and i'm trying to R/W from and into a file...i used the library "fstream.h" but the scanner shows invalid token...

#include <stdio.h>
#include <string.h>
#include <iostream.h>
#include <fstream.h>

int main()
{
        ifstream inFile;  // object for reading from a file
        ofstream outFile; // object for writing to a file

        inFile.open(path, ios::in);
        outFile.open(path, ios::out); 
        return 0;
}

Thanks in Advance,

Mostafa Fouly

Recommended Answers

All 4 Replies

path going to..?

a path to file
ex:c://windows.......

As far as I know you must use <iostream> and <fstream> headers and namespace std with Open Watcom C++ STL (incomplete) implementation (OWSTL) now.
The old good WATCOM is a rather specific compiler. It seems the best place to get answers about OW peculiarities is OW community wiki and forum. See, for example:
http://www.openwatcom.org/index.php/Open_Watcom_FAQ

Path for input and output..Isn't it same?..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.