Re: Trouble with variable types (void *)
From: Olaf Martens (olafmartens_at_arcor.de)
Date: 02/01/04
- Next message: CBFalconer: "Re: Any C/C++ LINT type checking recomendations"
- Previous message: Christian Br?nnum-Hansen: "Huge problem with memory usage"
- In reply to: Victor Bazarov: "Re: Trouble with variable types (void *)"
- Next in thread: Rolf Magnus: "Re: Trouble with variable types (void *)"
- Reply: Rolf Magnus: "Re: Trouble with variable types (void *)"
- Reply: John Harrison: "Re: Trouble with variable types (void *)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 01 Feb 2004 16:43:04 +0100
Victor Bazarov schrieb:
> "Olaf Martens" <olafmartens@arcor.de> wrote in message
> news:401d0ec2$0$17562$9b4e6d93@newsread4.arcor-online.net...
>
>>Here's another problem that appeared recently:
>>
>>I have the following function call:
>>
>>l_test->Compress(&"filename.dat",l_buf);
>
>
> What's the "&" for?
g++ would complain otherwise and issue a warning: Deprecated conversion of
string constants to char *...
>
[snip]
>
> Drop the ampersand.
It's the second parameter that bothers me, not the first!
>
>
[snip]
>
> No, you missed the fact that you're not supposed to take addresses
> of literals.
Oh, really? And why does g++ complain when omitting the &, then?
So, once more: The problem is *NOT* the string literal, but the second
parameter (l_buf)!!!
-- Olaf Martens Linux User #246244 http://counter.li.org/ Hugo-Luther-Str. 8 E-Mail: olafmartens@arcor.de 38118 Braunschweig Fon: +49-531-314834 "Who the heck is General Failure, and why is he reading my harddisk?"
- Next message: CBFalconer: "Re: Any C/C++ LINT type checking recomendations"
- Previous message: Christian Br?nnum-Hansen: "Huge problem with memory usage"
- In reply to: Victor Bazarov: "Re: Trouble with variable types (void *)"
- Next in thread: Rolf Magnus: "Re: Trouble with variable types (void *)"
- Reply: Rolf Magnus: "Re: Trouble with variable types (void *)"
- Reply: John Harrison: "Re: Trouble with variable types (void *)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|