🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Ger Timmens Wed, 04 Nov 1992 14:43
attach to ifstream
#29
Author: Ger Timmens
Date: Wed, 04 Nov 1992 14:43
27 lines
1204 bytes
I want to attach an ifstream to cin, is this possible with
g++ (version 2.2.2) ?

What I want to do is:

void SomeFunction(string szFileName)
{
    ifstream InStream;

    if (szFileName == "")
    {
        InStream.attach(0);                 // attach InStream to cin
    }
    else
    {
        InStream.open(szFileName, ios::in); // attach InStream to szFileName
    }

    ...
}

Thanks in advance,
-- 
Ger Timmens (ger@cv.ruu.nl) 3DCV Research Group, Utrecht, The Netherlands
Tel.: +31 -30 50 67 11;      Room: F.01.7.03;      Fax.: +31 -30 51 33 99
.....I'd rather hear Chet miss a note, than Wynton make a thousand......
Chet - Miles - Kenny - Lee - Arturo - Fats - Wynton - Art - Louis - Bix -
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads