home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / atari / st / tech / 4460 < prev    next >
Encoding:
Text File  |  1992-08-18  |  1.7 KB  |  39 lines

  1. Newsgroups: comp.sys.atari.st.tech
  2. Path: sparky!uunet!cs.utexas.edu!asuvax!ukma!vlsi!ulkyvx.louisville.edu!R0MILL01
  3. From: r0mill01@ulkyvx.louisville.edu (Robert Delius Royar)
  4. Subject: Re: Using Setexec() [a bit of help needed]
  5. Message-ID: <1992Aug18.102246.21175@vlsi.louisville.edu>
  6. Sender: news@vlsi.louisville.edu (Network News System)
  7. Nntp-Posting-Host: ulkyvx03.louisville.edu
  8. Reply-To: r0mill01@ulkyvx.louisville.edu
  9. Organization: University of Louisville
  10. References: <1992Aug17.083005.6390@aber.ac.uk>,<1992Aug17.175736.7804@pbhya.PacBell.COM>
  11. Date: Tue, 18 Aug 1992 10:22:46 GMT
  12. Lines: 25
  13.  
  14. In article <1992Aug17.175736.7804@pbhya.PacBell.COM>, dbsuthe@pbhya.PacBell.COM (Daniel B. Suthers) writes:
  15. >execute under any C compiler.  The name of a function evaluates to the
  16. >address of the function just like the name of an array does.
  17. >
  18. >
  19. >   void (*jumpto)();        /* A pointer to a function. */
  20. >   void sec_on();        /* Declare that the sec_on function exists. */
  21. >
  22. >   jumpto = sec_on;    /* Set the pointer to the address of the function*/
  23. >   jumpto();        /* Execute the function that's at the address
  24. >             * pointed to by the pointer.
  25. >             */
  26. >Daniel B. Suthers,  CCP
  27. >Technology Consultant, PCS & IN Development Lab,        Pac*Bell
  28. >Voice: (510) 671-1325               UUCP:  pacbell!pbeos!dbsuthe
  29. >================================================================================
  30. >=  Commit unexpected kindness and senseless acts of beauty.                    =
  31. >================================================================================
  32.  
  33. If jumpto is a pointer to a function, won't the call jumpto() cause a "bad 
  34. indirection" error in the compiler?  Shouldn't it be called by
  35.  (*jumpto)();  ?
  36.  
  37. r. royar (NYIT no address from here)
  38.  
  39.