First C program

Frank Kolmann <[email protected]>
Newsgroups gmane.comp.lang.as400.c
Message-ID <CAB-SQvhXn-opPF0GGme1bKtcfgE6eOgUWfyx6q2tDwYW=mm93A@mail.gmail.com>
Hi

I have recoded the program based on suggestions from Barbara and Jevgeni.
I have posted the new source here.
http://wiki.midrange.com/index.php/C_version_of_DISPR
As Barbara suggested I moved the Open of the files into a function.
I had to make the file pointers GLOBAL, to get the program to work.

However if I defined the file pointers in 'main'.
I could not get the function to update the file pointers.
Any suggestions on how to define the pointers for the file OPEN.

I tried this (from compile listing)  ( amongst many other attempts)


  82       |int main(void)
  83       |{
  84       |
  85       |    _RFILE           rpf   ;
==========> .....................a................................
=INFORMATIONAL===> a - CZM0359  Automatic variable rpf contains a
  86     1 |    _RFILE           *pf  = &rpf ;
  87       |    _RFILE           rsubf ;
==========> .....................a................................
=INFORMATIONAL===> a - CZM0359  Automatic variable rsubf contains
  88     2 |    _RFILE           *subf = &rsubf;
  89       |    _RFILE           rsopf ;
==========> .....................a................................
*=INFORMATIONAL===> a - CZM0359  Automatic variable rsopf contains
a const member and is not initialised
  90     3 |    _RFILE           *sopf = &rsopf;

Frank Kolmann
-- 
This is the Bare Metal Programming IBM i (AS/400 and iSeries) (C400-L) mailing list
To post a message email: C400-L-Zwy7GipZuJhWk0Htik3J/[email protected]
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/c400-l
or email: C400-L-request-Zwy7GipZuJhWk0Htik3J/[email protected]
Before posting, please take a moment to review the archives
at http://archive.midrange.com/c400-l.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.