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