473,465 Members | 1,945 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

allowing a function to be called only from a specific function

Hi,

Is there any way, by which we can limit a specific function to be
called
only from a specific function ? I dont know the advantage of this.
Someone
asked this question from me in an interview.

thanks for any help ...

Nov 29 '06 #1
24 1305
ju**********@yahoo.co.in said:
Hi,

Is there any way, by which we can limit a specific function to be
called
only from a specific function ? I dont know the advantage of this.
Someone
asked this question from me in an interview.

thanks for any help ...
For ease of reference, let's call them foo() and bar(), and you want it to
be impossible to call bar() except from foo().

Put foo() and bar() in foo.c. Make bar() static:

static int bar(double *, void ***, char, unsigned long);

Compile foo.c to an object file, and publish the object file, together with
the interface spec (foo.h, which need not and indeed should not even
mention bar() at all), to your users. Don't give them the source file. :-)
They don't need it, and it'd only get them poking around in the guts of
bar(), which is presumably what you're trying to prevent.

Provided you do not export bar()'s address from foo() - and if you don't
know what I'm talking about, it's extremely unlikely that you'd do this by
accident! - then you will now only be able to call bar() from foo().

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Nov 29 '06 #2


On Nov 29, 3:50 pm, Richard Heathfield <r...@see.sig.invalidwrote:
junky_fel...@yahoo.co.in said:
Hi,
Is there any way, by which we can limit a specific function to be
called
only from a specific function ? I dont know the advantage of this.
Someone
asked this question from me in an interview.
thanks for any help ...For ease of reference, let's call them foo() and bar(), and you want it to
be impossible to call bar() except from foo().

Put foo() and bar() in foo.c. Make bar() static:

static int bar(double *, void ***, char, unsigned long);

Compile foo.c to an object file, and publish the object file, together with
the interface spec (foo.h, which need not and indeed should not even
mention bar() at all), to your users. Don't give them the source file. :-)
They don't need it, and it'd only get them poking around in the guts of
bar(), which is presumably what you're trying to prevent.

Provided you do not export bar()'s address from foo() - and if you don't
know what I'm talking about, it's extremely unlikely that you'd do this by
accident! - then you will now only be able to call bar() from foo().
In fact, I also suggested the same thing, but he said that there could
be
multilpe functions (say f1(), f2(), f3(), f4() etc) in the some file
and
f1() should be allowed to be called only from f2() and not from any
other function in that file or in some other file. Is there any way of
doing it ?

Nov 29 '06 #3

ju**********@yahoo.co.in wrote:
On Nov 29, 3:50 pm, Richard Heathfield <r...@see.sig.invalidwrote:
junky_fel...@yahoo.co.in said:
Hi,
Is there any way, by which we can limit a specific function to be
called only from a specific function ?
....
Put foo() and bar() in foo.c. Make bar() static:

static int bar(double *, void ***, char, unsigned long);

Compile foo.c to an object file, and publish the object file, together with
the interface spec (foo.h, which need not and indeed should not even
mention bar() at all), to your users. Don't give them the source file. :-)
They don't need it, and it'd only get them poking around in the guts of
bar(), which is presumably what you're trying to prevent.

Provided you do not export bar()'s address from foo() - and if you don't
know what I'm talking about, it's extremely unlikely that you'd do this by
accident! - then you will now only be able to call bar() from foo().
In fact, I also suggested the same thing, but he said that there could
be multilpe functions (say f1(), f2(), f3(), f4() etc) in the some file
and f1() should be allowed to be called only from f2() and not from any
other function in that file or in some other file. Is there any way of
doing it ?
Not within the specification of the language, I wouldn't think.

There could be platform-specific ways, involving all manner of horrid
sub-rosa knowledge.

Nov 29 '06 #4
ju**********@yahoo.co.in wrote:
On Nov 29, 3:50 pm, Richard Heathfield <r...@see.sig.invalidwrote:
junky_fel...@yahoo.co.in said:
Hi,
Is there any way, by which we can limit a specific function to be
called only from a specific function ? I dont know the advantage of this.
Someone asked this question from me in an interview.
>
thanks for any help ...
For ease of reference, let's call them foo() and bar(), and you want it to
be impossible to call bar() except from foo().

Put foo() and bar() in foo.c. Make bar() static:
<snip>
Provided you do not export bar()'s address from foo() - and if you don't
know what I'm talking about, it's extremely unlikely that you'd do this by
accident! - then you will now only be able to call bar() from foo().
In fact, I also suggested the same thing, but he said that there could
be multilpe functions (say f1(), f2(), f3(), f4() etc) in the some file
and f1() should be allowed to be called only from f2() and not from any
other function in that file or in some other file. Is there any way of
doing it ?
I think you want C++.

Nov 29 '06 #5
ma**********@pobox.com wrote:
>
ju**********@yahoo.co.in wrote:
>On Nov 29, 3:50 pm, Richard Heathfield <r...@see.sig.invalidwrote:
junky_fel...@yahoo.co.in said:

Hi,

Is there any way, by which we can limit a specific function to be
called only from a specific function ?
...
Put foo() and bar() in foo.c. Make bar() static:

static int bar(double *, void ***, char, unsigned long);

Compile foo.c to an object file, and publish the object file, together with
the interface spec (foo.h, which need not and indeed should not even
mention bar() at all), to your users. Don't give them the source file. :-)
They don't need it, and it'd only get them poking around in the guts of
bar(), which is presumably what you're trying to prevent.

Provided you do not export bar()'s address from foo() - and if you don't
know what I'm talking about, it's extremely unlikely that you'd do this by
accident! - then you will now only be able to call bar() from foo().
In fact, I also suggested the same thing, but he said that there could
be multilpe functions (say f1(), f2(), f3(), f4() etc) in the some file
and f1() should be allowed to be called only from f2() and not from any
other function in that file or in some other file. Is there any way of
doing it ?

Not within the specification of the language, I wouldn't think.
/* insert any necessary forward declarations here
(but, of course, not for f1)
*/

f3() { ... }

f4() { ... }

f5() { ... }

static f1() { ... }

f2() { ... f1() ... }

--
Chris "subtle, like a barrel" Dollin
"Our future looks secure, but it's all out of our hands"
- Magenta, /Man and Machine/

Nov 29 '06 #6
In article <11**********************@j72g2000cwa.googlegroups .com>,
ju**********@yahoo.co.in <ju**********@yahoo.co.inwrote:
>In fact, I also suggested the same thing, but he said that there
could be multilpe functions (say f1(), f2(), f3(), f4() etc) in the
some file and f1() should be allowed to be called only from f2() and
not from any other function in that file or in some other file. Is
there any way of doing it ?
It's hard to make much sense of this without knowing the purpose of
the constraint. If someone can change f3 so that it tries to call f1,
they can edit the rest of the file to remove any mechanism you have
used to prevent it (unless you have some magic editor that only allows
you to change part of the file, in which case it could enforce the
rule about calling f1 too).

If you suppose that the aim is to prevent someone inadvertently calling
it in a context where it would be inappropriate, you might do it by
naming the function "f1_but_do_not_call_this_function", and putting
#define f1 f1_but_do_not_call_this_function at the beginning of f2
and #undef f1 at the end of it.

I would probably just put a comment on f1 describing the circumstances
in which it was safe to call it.

-- Richard
--
"Consideration shall be given to the need for as many as 32 characters
in some alphabets" - X3.4, 1963.
Nov 29 '06 #7
On Wed, 29 Nov 2006 04:11:43 -0800, mark_bluemel wrote:
>
ju**********@yahoo.co.in wrote:
>On Nov 29, 3:50 pm, Richard Heathfield <r...@see.sig.invalidwrote:
junky_fel...@yahoo.co.in said:

Hi,

Is there any way, by which we can limit a specific function to be
called only from a specific function ?
...
<snip>
Not within the specification of the language, I wouldn't think.

There could be platform-specific ways, involving all manner of horrid
sub-rosa knowledge.
Off Topic:
Or you could use a specific compiler's language extension, for example gcc
allows nested functions.
Nov 29 '06 #8
ju**********@yahoo.co.in wrote:
[...]
In fact, I also suggested the same thing, but he said that there could
be
multilpe functions (say f1(), f2(), f3(), f4() etc) in the some file
and
f1() should be allowed to be called only from f2() and not from any
other function in that file or in some other file. Is there any way of
doing it ?
Make f1() static and place it next-to-last in the file,
right before f2(). Threaten to crush the gizzards of anyone
who writes a forward declaration of f1() earlier in the file.

Make f1() static and place it first in the file, right
before f2(). Follow f2 with `#define f1 >* die, slime! *<'
and threaten to crush the gizzards of anyone who writes an
`#undef f1'.

Give f1() external linkage, publish its declaration in an
appropriate header file, and threaten to crush the gizzards
of anyone who calls it from anyplace except within f2().

There's nothing I can think of that doesn't ultimately
rest on someone's unwillingness to have his gizzards crushed.
Compilers are not nannies.

--
Eric Sosman
es*****@acm-dot-org.invalid
Nov 29 '06 #9
ju**********@yahoo.co.in <ju**********@yahoo.co.inwrote:
In fact, I also suggested the same thing, but he said that there could
be
multilpe functions (say f1(), f2(), f3(), f4() etc) in the some file
and
f1() should be allowed to be called only from f2() and not from any
other function in that file or in some other file. Is there any way of
doing it ?
Not really, but you could do something like this anyway - document
f1() to be called by a macro INVOKE_F1 and only define the macro to
correctly invoke f1() inside f2():

#include <stdio.h>
#include <stdlib.h>

#define INVOKE_F1() fprintf( stderr, "Invalid invocation of f1\n" ); abort();

void f1() {
printf( "Invoked f1()\n" );
}

void f2() {
#undef INVOKE_F1
#define INVOKE_F1() f1()
INVOKE_F1();
#undef INVOKE_F1
#define INVOKE_F1() fprintf( stderr, "Invalid invocation of f1\n" ); abort();
}

void f3() {
INVOKE_F1();
}

int main(void) {
f2();
f3();
return 0; /* Not reached. */
}

--
C. Benson Manica | I *should* know what I'm talking about - if I
cbmanica(at)gmail.com | don't, I need to know. Flames welcome.
Nov 29 '06 #10

<ju**********@yahoo.co.inwrote in message
news:11**********************@j72g2000cwa.googlegr oups.com...
>

On Nov 29, 3:50 pm, Richard Heathfield <r...@see.sig.invalidwrote:
>junky_fel...@yahoo.co.in said:
Hi,
Is there any way, by which we can limit a specific function to be
called
only from a specific function ? I dont know the advantage of this.
Someone
asked this question from me in an interview.
thanks for any help ...For ease of reference, let's call them foo() and
bar(), and you want it to
be impossible to call bar() except from foo().

Put foo() and bar() in foo.c. Make bar() static:

static int bar(double *, void ***, char, unsigned long);

Compile foo.c to an object file, and publish the object file, together
with
the interface spec (foo.h, which need not and indeed should not even
mention bar() at all), to your users. Don't give them the source file.
:-)
They don't need it, and it'd only get them poking around in the guts of
bar(), which is presumably what you're trying to prevent.

Provided you do not export bar()'s address from foo() - and if you don't
know what I'm talking about, it's extremely unlikely that you'd do this
by
accident! - then you will now only be able to call bar() from foo().
In fact, I also suggested the same thing, but he said that there could
be
multilpe functions (say f1(), f2(), f3(), f4() etc) in the some file
and
f1() should be allowed to be called only from f2() and not from any
other function in that file or in some other file. Is there any way of
doing it ?
The interviewer is out of date.
Some old-time C compilers allowed the use of local function definitons

int foo()
{
int bar(int, int);

return bar(1,2);
}

int bar()
int x,
int y
{
return 0;
}

bar is now local to foo(). I think I've got that right. It never caught on
and now static is the universally-approved way of restricting access to a
function.
--
www.personal.leeds.ac.uk/~bgy1mm
freeware games to download.
Nov 29 '06 #11
Chris Dollin wrote:
ju**********@yahoo.co.in wrote:
Is there any way, by which we can limit a specific function to be
called only from a specific function ?

f3() { ... }

f4() { ... }

f5() { ... }

static f1() { ... }

f2() { ... f1() ... }
f3() can still write:
int f1();

to declare f1, and then call it.

Nov 29 '06 #12
santosh wrote:
ju**********@yahoo.co.in wrote:
In fact, I also suggested the same thing, but he said that there could
be multilpe functions (say f1(), f2(), f3(), f4() etc) in the some file
and f1() should be allowed to be called only from f2() and not from any
other function in that file or in some other file. Is there any way of
doing it ?

I think you want C++.
C++ does not support this either.

Nov 29 '06 #13
"Malcolm" <re*******@btinternet.comwrites:
[...]
The interviewer is out of date.
Some old-time C compilers allowed the use of local function definitons

int foo()
{
int bar(int, int);

return bar(1,2);
}

int bar()
int x,
int y
{
return 0;
}

bar is now local to foo(). I think I've got that right. It never caught on
and now static is the universally-approved way of restricting access to a
function.
That's not a local function definition; it's merely a local function
declaration. It's still perfectly legal, just as it always has been,
though it's widely considered to be poor style. (This specific
example would have been illegal before the introduction of prototypes,
but a local "int bar();" would have been legal.)

(There are other problems with the code.)

A local function *definition* would look like this:

int foo(void)
{
int bar(int x, int y)
{
return 0;
}
return bar(1, 2);
}

This has never been legal in standard C. <OT>gcc allows it as an
extension.</OT>

Nested functions make the compiler's job more difficult if it has to
support an inner function referring to an object declared in an outer
function.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 30 '06 #14
Old Wolf wrote:
Chris Dollin wrote:
ju**********@yahoo.co.in wrote:
Is there any way, by which we can limit a specific function to be
called only from a specific function ?
f3() { ... }

f4() { ... }

f5() { ... }

static f1() { ... }

f2() { ... f1() ... }

f3() can still write:
int f1();

to declare f1, and then call it.
When f1 is defined static, it cannot.

Nov 30 '06 #15

ju**********@yahoo.co.in wrote:
Hi,

Is there any way, by which we can limit a specific function to be
called
only from a specific function ? I dont know the advantage of this.
Someone
asked this question from me in an interview.

thanks for any help ...
Lotsa ways to do it:

#define f5 if( strcmp( __FUNC__, "f2" ) == 0 ) f5 (); else
printf("cant call f2 from here");

or if your compiler doesnt have __FUNC__, test for __LINE__

or:

#define f5(x) f5 ( __FUNC__, x )
... then have f5 do the strcmp() for the function names its allowed to
be called from.

or:

in global scope have: char f5;

so nobody can call f5, except f2 is:

void f2( void ){ void f5(); // or whatever, now f5 can be called but
only from in here
}

Nov 30 '06 #16
Harald van D?k wrote:
Old Wolf wrote:
>Chris Dollin wrote:
>>ju**********@yahoo.co.in wrote:

Is there any way, by which we can limit a specific function to be
called only from a specific function ?

f3() { ... }

f4() { ... }

f5() { ... }

static f1() { ... }

f2() { ... f1() ... }

f3() can still write:
int f1();

to declare f1, and then call it.

When f1 is defined static, it cannot.
Yes it can. The 'static' only prevents visibility outside the
compilation unit.

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>
Nov 30 '06 #17
Old Wolf wrote:
Chris Dollin wrote:
ju**********@yahoo.co.in wrote:
Is there any way, by which we can limit a specific function to be
called only from a specific function ?

f3() { ... }

f4() { ... }

f5() { ... }

static f1() { ... }

f2() { ... f1() ... }

f3() can still write:
int f1();

to declare f1, and then call it.
No solution - not even the ones in languages which support interesting
visibility rules - is robust against source editing.

--
Chris "subtle, like a barrel" Dollin
"A facility for quotation covers the absence of original thought." /Gaudy Night/

Nov 30 '06 #18
CBFalconer wrote:
Harald van D?k wrote:
Old Wolf wrote:
Chris Dollin wrote:
ju**********@yahoo.co.in wrote:

Is there any way, by which we can limit a specific function to be
called only from a specific function ?

f3() { ... }

f4() { ... }

f5() { ... }

static f1() { ... }

f2() { ... f1() ... }

f3() can still write:
int f1();

to declare f1, and then call it.
When f1 is defined static, it cannot.

Yes it can. The 'static' only prevents visibility outside the
compilation unit.
No, it cannot. f3 is defined before f1 is declared. You can refer to a
static function or variable with an extern declaration if and only if
the a static declaration is already in scope, and you cannot use static
on a function declaration with block scope.

Nov 30 '06 #19
Old Wolf <ol*****@inspire.net.nzwrote:
santosh wrote:
I think you want C++.
C++ does not support this either.
Right, although he may have been thinking of friends and similar
things, which can do something like OP wanted, albeit for classes and
not functions as was required.

--
C. Benson Manica | I *should* know what I'm talking about - if I
cbmanica(at)gmail.com | don't, I need to know. Flames welcome.
Dec 1 '06 #20
Harald van D?k wrote:
CBFalconer wrote:
.... snip ...
>>
Yes it can. The 'static' only prevents visibility outside the
compilation unit.

No, it cannot. f3 is defined before f1 is declared. You can refer
to a static function or variable with an extern declaration if and
only if the a static declaration is already in scope, and you
cannot use static on a function declaration with block scope.
Counter example. Nothing says you have to heed warnings. Proper
isolation requires a separate source file.

[1] c:\c\junk>cat junk.c
#include <stdio.h>

int main(void) {
void f1(void);

f1();
return 0;
} /* main */

static void f1(void) {
puts("In f1");
}

[1] c:\c\junk>cc junk.c
junk.c:10: warning: `f1' was declared `extern' and later `static'

[1] c:\c\junk>.\a
In f1

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>
Dec 1 '06 #21
CBFalconer schreef:
Harald van D?k wrote:
CBFalconer wrote:
... snip ...
>
Yes it can. The 'static' only prevents visibility outside the
compilation unit.
No, it cannot. f3 is defined before f1 is declared. You can refer
to a static function or variable with an extern declaration if and
only if the a static declaration is already in scope, and you
cannot use static on a function declaration with block scope.

Counter example. Nothing says you have to heed warnings. Proper
isolation requires a separate source file.

[1] c:\c\junk>cat junk.c
#include <stdio.h>

int main(void) {
void f1(void);

f1();
return 0;
} /* main */

static void f1(void) {
puts("In f1");
}

[1] c:\c\junk>cc junk.c
junk.c:10: warning: `f1' was declared `extern' and later `static'

[1] c:\c\junk>.\a
In f1
That's nice. As far as standard C is concerned, the behaviour is
undefined per 6.2.2p7, and my compiler rejects it. If you count
implementation-specific extensions, then inline assembly may also allow
you to access static functions defined in another source file.

Dec 1 '06 #22
Harald van D?k wrote:
>
CBFalconer schreef:
Harald van D?k wrote:
CBFalconer wrote:
>
... snip ...
>>
>Yes it can. The 'static' only prevents visibility outside the
>compilation unit.
>
No, it cannot. f3 is defined before f1 is declared. You can refer
to a static function or variable with an extern declaration if and
only if the a static declaration is already in scope, and you
cannot use static on a function declaration with block scope.
Counter example. Nothing says you have to heed warnings. Proper
isolation requires a separate source file.

[1] c:\c\junk>cat junk.c
#include <stdio.h>

int main(void) {
void f1(void);

f1();
return 0;
} /* main */

static void f1(void) {
puts("In f1");
}

[1] c:\c\junk>cc junk.c
junk.c:10: warning: `f1' was declared `extern' and later `static'

[1] c:\c\junk>.\a
In f1

That's nice. As far as standard C is concerned, the behaviour is
undefined per 6.2.2p7, and my compiler rejects it. If you count
implementation-specific extensions, then inline assembly may also allow
you to access static functions defined in another source file.
Then try this:

#include <stdio.h>
static void f1(void);

int main(void) {

f1();
return 0;
} /* main */

static void f1(void) {
puts("In f1");
}

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>

Dec 1 '06 #23
ju**********@yahoo.co.in wrote:
Hi,

Is there any way, by which we can limit a specific function to be
called
only from a specific function ? I dont know the advantage of this.
Someone
asked this question from me in an interview.

thanks for any help ...
Realistically? Not properly in stdc. The following should be
'good enough' for most practical porpoises.

------------protected.h---------------
#define function(x,y) protected_function (__func__, x, y)

------------protected.c---------------
void protected_function (char *caller, int x, int y)
{
char *legal_callers[] = {
"foo",
"bar",
"baz",
};
int allowed = 0;
size_t i;

for (i=0; i<sizeof legal_callers/sizeof legal_callers[0]; i++) {
if (strcmp (caller, legal_callers)==0) {
allowed = 1;
break;
}
}

if (!allowed) {
return;
}

/* Rest of function goes here */
/* Do something with x and y */
}

<OT>
If it is proper security you are looking for, you are out of
luck; there isn't a single programming language that I know
of that has builtin authentication (or identification) for
functions (and objects) and authorisation (or access controls)
for functions (and objects).

There are some experiments with *code-signing* on newer platforms,
but these apply to the entire platform (.Net or, IIRC, Java?) and
probably do not go down to the granularity you want.

The closest you will get is using gcc[1] and the extensions it
provides (builtin_apply_args, builtin_apply and builtin_return[2])
wrapped in a function that does authentication and/or authorisation.

[1] Or any other compiler with the appropriate extensions.
[2] Or the extensions provided that allow this type of thing.

</OT>

The other option is to have only two functions in a
source file. One is the actual function to call and is
static and the other function is merely a wrapper to
authenticate/authorise the credentials supplied and
invoke the static function (or return a pointer to it).
goose,

Dec 1 '06 #24
CBFalconer wrote:
Harald van D?k wrote:

CBFalconer schreef:
Harald van D?k wrote:
CBFalconer wrote:

... snip ...
>
Yes it can. The 'static' only prevents visibility outside the
compilation unit.

No, it cannot. f3 is defined before f1 is declared. You can refer
to a static function or variable with an extern declaration if and
only if the a static declaration is already in scope, and you
cannot use static on a function declaration with block scope.
>
Counter example. Nothing says you have to heed warnings. Proper
isolation requires a separate source file.
>
[1] c:\c\junk>cat junk.c
#include <stdio.h>
>
int main(void) {
void f1(void);
>
f1();
return 0;
} /* main */
>
static void f1(void) {
puts("In f1");
}
>
[1] c:\c\junk>cc junk.c
junk.c:10: warning: `f1' was declared `extern' and later `static'
>
[1] c:\c\junk>.\a
In f1
That's nice. As far as standard C is concerned, the behaviour is
undefined per 6.2.2p7, and my compiler rejects it. If you count
implementation-specific extensions, then inline assembly may also allow
you to access static functions defined in another source file.

Then try this:

#include <stdio.h>
static void f1(void);

int main(void) {

f1();
return 0;
} /* main */

static void f1(void) {
puts("In f1");
}
That's of course allowed, but Chris Dollin's original post of this
subthread already stated that there should be no such forward
declaration. The idea is that main() cannot call f1() without outside
help.

Dec 1 '06 #25

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Dave | last post by:
Hello NG, If a particular dynamic library gets loaded, I need to ensure that a function in that library gets executed on startup (and I want the mechanism to use only Standard C++). Here's what...
11
by: Enquiries, Hopkins Research | last post by:
Hi all I have a conundrum that is puzzling me. I have a large codebase in C that I am converting to C++ as fast as possible (i.e. slowly because I keep learning new idioms and stumbling with...
4
by: anonymous | last post by:
Thanks your reply. The article I read is from www.hakin9.org/en/attachments/stackoverflow_en.pdf. And you're right. I don't know it very clearly. And that's why I want to understand it; for it's...
7
by: jsale | last post by:
I'm currently using ASP.NET with VS2003 and SQL Server 2003. The ASP.NET app i have made is running on IIS v6 and consists of a number of pages that allow the user to read information from the...
14
by: Mr Newbie | last post by:
I am often in the situation where I want to act on the result of a function, but a simple boolean is not enough. For example, I may have a function called isAuthorised ( User, Action ) as ?????...
3
by: Beta What | last post by:
Hello, I have a question about casting a function pointer. Say I want to make a generic module (say some ADT implementation) that requires a function pointer from the 'actual/other modules'...
89
by: Cuthbert | last post by:
After compiling the source code with gcc v.4.1.1, I got a warning message: "/tmp/ccixzSIL.o: In function 'main';ex.c: (.text+0x9a): warning: the 'gets' function is dangerous and should not be...
28
by: Larax | last post by:
Best explanation of my question will be an example, look below at this simple function: function SetEventHandler(element) { // some operations on element element.onclick = function(event) {
6
by: RandomElle | last post by:
Hi there I'm hoping someone can help me out with the use of the Eval function. I am using Access2003 under WinXP Pro. I can successfully use the Eval function and get it to call any function with...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.