delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/05/29/18:42:17

From: Alcaraz <al661090 AT campus DOT gda DOT itesm DOT mx>
Newsgroups: comp.os.linux.development.apps,comp.os.msdos.djgpp,comp.unix.programmer
Subject: Re: C++ Passing ostreams by reference to methods, problem
Date: Thu, 29 May 1997 13:51:00 -0500
Organization: ITESM Campus Monterrey . DINF-DTCI
Lines: 18
Message-ID: <338DD014.15FB@campus.gda.itesm.mx>
References: <01bc6b49$27fce100$1b2443a1 AT pcoec DOT uclm DOT es>
NNTP-Posting-Host: galileo.gda.itesm.mx
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Pues me imagino que estos es lo que quieres:


#include <fstream.h>
#include <stdlib.h>

void escribe (ofstream *file){
  *file << "Prueba";
}

void main(){
  ofstream file("salida");
  escribe(&file);
  file.close();
}


Esto si funciona perfectamente.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019