delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/06/04/21:06:18

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: 19
Message-ID: <5441B81CC59BE4A4.36C092E13CDF0BC9.32EBCA2D02F566E9@library-proxy.airnews.net>
References: <01bc6b49$27fce100$1b2443a1 AT pcoec DOT uclm DOT es>
NNTP-Proxy-Relay: library.airnews.net
NNTP-Posting-Host: biceps.gymnet.com
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