Function pointers

D

dhaval070

--=_Next_Part_S46I7XUVDKILW6YF
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Does function pointer work on protected mode operation systems programs????


--=_Next_Part_S46I7XUVDKILW6YF--
 
P

p_cricket_guy

Does function pointer work on protected mode operation systems programs????

Function pointers must "work" on any conforming implementation
of the C standard, irrespective of the operating system or underlying
system architecture.

<guess>
Perhaps your question is: "Is it possible to use a C function pointer
to invoke any arbitrary function while running in a specific Operating
mode of a specific (clas of) Operating System ?".

In that case, your question is off-topic here. Please look out for a
more specific newsgroup.

- p_cricket_guy
 
R

Richard Heathfield

(e-mail address removed) said:
Does function pointer work on protected mode operation systems
programs????

No. Function pointers are merely values. They don't do work. But yes, the
work they don't do is just as effective in protected-mode operating systems
as it is in real mode systems.
 
D

Dag Viken

Richard Heathfield said:
(e-mail address removed) said:


No. Function pointers are merely values. They don't do work. But yes, the
work they don't do is just as effective in protected-mode operating
systems
as it is in real mode systems.

And, of course, functions don't do work; they are merely a collection of
compiled instructions that can be executed by a CPU.

Dag
 
N

Nick Keighley

Dag said:
And, of course, functions don't do work; they are merely a collection of
compiled instructions that can be executed by a CPU.

The Standard does not require functions to be compiled.
 
D

David Wade

Does function pointer work on protected mode operation systems programs????

Why wouldn't they? I believe that a function pointer should only point to
other "C" function in the same "run unit/linked program" or whatever your OS
supports. So its not like you are executing data. Nor are you executing
arbitary code. What may not work is trying to load arbitary addresses into
function pointers. So if somewhere in the OS there is a table of OS system
calls you may not be able to load those into function pointers and call
them.
 
D

Dag Viken

Nick Keighley said:
The Standard does not require functions to be compiled.


--
Nick Keighley

This newsgroup considers pedantry to be an art form.
Richard Heathfield
Agreed, we should program by flipping switches to directly enter pure binary
machine code.
Let us compile only mentally and theoretically!

Hooray, thank you,
Dag

(And BTW, yes, I do believe pedantry is an art form)
 
R

Richard Bos

Dag Viken said:
Agreed, we should program by flipping switches to directly enter pure binary
machine code.
Let us compile only mentally and theoretically!

Ah, Grasshopper... write an interpreter for C. When it implements C99
fully, you may be enlightened.

Richard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,197
Latest member
ScottChare

Latest Threads

Top