Subject:
|
Re: How to make shared memory....not
|
Newsgroups:
|
lugnet.robotics.rcx.legos
|
Date:
|
Thu, 27 Dec 2001 14:43:03 GMT
|
Viewed:
|
1946 times
|
| |
| |
In lugnet.robotics.rcx.legos, Michael Obenland writes:
>
> BTW., this scheme can be extended to something like a shared library. If you
> store pointers to functions instead of ints, you can call a routine in
> Program 1 from Program 2 or 3.
ooohh. I like that idea. So I can write one program with all my functions
and my other programs can just include a couple function calls.
Again, in my VB world, I don't mess with pointers. When you have a minute,
can you type up a sample function? (with a sample call)
Thanks!
Steve
|
|
Message has 2 Replies: | | Re: How to make shared memory....not
|
| I think this is what you want, but I am still learning. :) int inc (int&); int dec (int&); int (*pFunc) (int); //pointer to a function that accepts/returns an int if (add) { pFunc = inc; } else { pFunc = dec; } int a = pFunc(10); So, if add is true, (...) (23 years ago, 27-Dec-01, to lugnet.robotics.rcx.legos)
| | | Re: How to make shared memory....not
|
| Hi Steve, (...) Yes. Actually, I am working on a robot that finds a path trough a maze. After solving the maze, a second program can run through the maze with the informations from the first program. (I will do this with shared mem). Both programs (...) (23 years ago, 28-Dec-01, to lugnet.robotics.rcx.legos)
|
Message is in Reply To:
| | Re: How to make shared memory....not
|
| (...) Yes. That is the only thing you have to do. You can store whatever you want. (...) Exactly. If you know you what you do, nothing bad can happen. BTW., this scheme can be extended to something like a shared library. If you store pointers to (...) (23 years ago, 27-Dec-01, to lugnet.robotics.rcx.legos)
|
11 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
This Message and its Replies on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|