|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools |
Rating:
|
Display Modes |
|
#1
|
||||
|
||||
|
void* pointer to object in C++
I have been at this for some time now, and this won't compile:
Code:
(function(int data))
void * MyPointer
if (data=0)
{
Gyro gy(1);
MyPointer = &gy;
}
if (data=1)
{
Ultrasonic gy(1);
MyPointer = &gy;
}
if (etc...
etc...
(function2(int data2))
if (data2=0)
return MyPointer->GetValue(); //this produces error: 'void*' is not a pointer-to-object type (:eek:)
etc...
![]() Last edited by byteit101 : 01-14-2009 at 03:45 PM. Reason: code bock |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Aiming that remote: Laser pointer allowed? | efoote868 | Rules/Strategy | 9 | 03-02-2008 09:01 PM |
| Pointer to pwm | bronxbomber92 | Programming | 5 | 02-07-2008 03:57 PM |
| Suspicious pointer conversion | ebowla | Programming | 2 | 01-26-2008 12:13 PM |
| laser pointer | 1574aviad | Technical Discussion | 9 | 02-20-2005 08:25 PM |
| problem with void Process_Data_From_Local_IO | CmptrGk | Programming | 2 | 01-29-2005 05:14 PM |