|
*Subject: Re: First C program
*From: Jevgeni Astanovski <Jevgeni.Astanovski@xxxxxxxxxxxxx>
*Date: Thu, 3 Apr 2014 11:17:52 +0000
If you want to open a file in a function and have its pointer available inmain, you must pass pointer to pointer!
Something like this:
int main()
{
_RFILE *fp ;
openfile(&fp) ;
}
void openfile(_RFILE **fp)
{
*fp = _Ropen(...) ;
}
(Bad) Alternative is to have it defined as global variable.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.