invalid conversion from ‘ProbeInfo_t**’ to ‘int’

M

Michael

list<int> myProbelist;

for( int probeA = 0; probeA < 100; probeA++)
{
ProbeInfo_t* tmpInfo = new ProbeInfo_t();
tmpInfo->structSize = sizeof( tmpInfo );
myProbelist.push_back( &tmpInfo );
....


Hi, doing as above I get:

- Invalid arguments ' Candidates are: void push_back(const int &) '
- invalid conversion from ‘ProbeInfo_t**’ to ‘int’
- initializing argument 1 of ‘void std::list<_Tp,
_Alloc>::push_back(const _Tp&) [with _Tp = int, _Alloc =

Probeinfo is a struct. Many thanks
Michael
 
F

Fred Zwarts \(KVI\)

"Michael" wrote in message
list<int> myProbelist;

for( int probeA = 0; probeA < 100; probeA++)
{
ProbeInfo_t* tmpInfo = new ProbeInfo_t();

tmpInfo is a pointer of type ProbeInfo_t*
tmpInfo->structSize = sizeof( tmpInfo );

You store the size of the pointer (usually 4 on 32-bit and 8 on 64-bit
platforms) somewhere.
myProbelist.push_back( &tmpInfo );

You try to store the address of the pointer.
This address has type ProbeInfo_t**
...


Hi, doing as above I get:

- Invalid arguments ' Candidates are: void push_back(const int &) '
- invalid conversion from ‘ProbeInfo_t**’ to ‘int’

That's the type I explained above.
- initializing argument 1 of ‘void std::list<_Tp, _Alloc>::push_back(const
_Tp&) [with _Tp = int, _Alloc =

Probeinfo is a struct. Many thanks
Michael

There is no question, so is there a problem?
 
S

SG

list<int> myProbelist;

for( int probeA = 0; probeA < 100; probeA++)
  {
ProbeInfo_t* tmpInfo = new ProbeInfo_t();
tmpInfo->structSize = sizeof( tmpInfo );
myProbelist.push_back( &tmpInfo );
...

Hi, doing as above I get:

- Invalid arguments 'Candidates are: void push_back(const int &)'
- invalid conversion from ProbeInfo_t** to int
- initializing argument 1 of void std::list<_Tp,
_Alloc>::push_back(const _Tp&) [with _Tp = int, _Alloc =

Probeinfo is a struct. Many thanks
Michael

- Help! If I stick a fork into my leg it'll hurt. I got the fork
from WMF. Many thanks. Michael.

- Well, of course it'll hurt ... unless your nerves are damaged
somehow. What did you expect? What is the point of sticking the
fork into your leg? You obviously don't want it to hurt. That
much is clear.

SG
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top