Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > invalid conversion from ‘ProbeInfo_t**’ to ‘int’

Reply
Thread Tools

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

 
 
Michael
Guest
Posts: n/a
 
      11-22-2011
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>:ush_back(const _Tp&) [with _Tp = int, _Alloc =

Probeinfo is a struct. Many thanks
Michael

 
Reply With Quote
 
 
 
 
Fred Zwarts \(KVI\)
Guest
Posts: n/a
 
      11-22-2011
"Michael" wrote in message
news:b3403$4ecb89d5$c299b7f6$(E-Mail Removed) ...
>
>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>:ush_back(const
>_Tp&) [with _Tp = int, _Alloc =
>
>Probeinfo is a struct. Many thanks
>Michael


There is no question, so is there a problem?

 
Reply With Quote
 
 
 
 
SG
Guest
Posts: n/a
 
      11-22-2011
On 22 Nov., 12:39, Michael wrote:
>
> 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>:ush_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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
invalid character in base-64 string and invalid postback or callba kevin ASP .Net 0 01-16-2008 09:39 PM
How do fix: "Wrong number of arguments" / "invalid propert assignment"/ "Invalid argument" Java Guy Javascript 1 10-15-2006 08:41 PM
How do fix: "Wrong number of arguments" / "invalid propert assignment"/ "Invalid argument" Java Guy Java 1 10-15-2006 08:31 PM
Invalid URI: There is an invalid sequence in the string. Error!! Patrick.O.Ige ASP .Net 1 07-02-2006 11:21 AM
invalid@invalid.org Hank Sniadoch Computer Information 1 08-20-2004 11:24 AM



Advertisments