![]() |
|
#1
|
|||
|
|||
Depreciated conversionhow do i get rid of these notices ?
main.cpp:24: warning: deprecated conversion from string constant to 'char*' Here is a sample array CPP / C++ / C Code:
I got a bunch of em in my code, and these gcc bothers me with 'em. |
|||
|
#2
|
|||
|
|||
Re: depreciated conversionMultiple solutions to your problem
1) use gcc flag to supress the warning -Wno-write-strings 2) make upto20 pointers as "static const" instead of static 3) Al though if you want to modiy the the values better to use two dimmensional array instead of array of pointers |
|
#3
|
|||
|
|||
Re: Depreciated conversionI tried it out and I still get errors.
By the way I am using QT Creator with gcc. |
|
#4
|
|||
|
|||
Re: Depreciated conversionQuote:
Quote:
So: I suggest that you reduce your program to the smallest amount of stuff that exhibits the problematic behavior and post the entire program. Show the command line that was used to compile the code. If you get compiler messages (or any other problems) that you don't understand and can't resolve, then paste the exact messages into your post. Bottom line: Don't just tell us; show us. If there are lots and lots of messages that are essentially the same, then just post the first ten or so. In the meanwhile: maybe you can try something like the following: CPP / C++ / C Code:
Compiled with Code:
No compiler messages (warnings or otherwise) with g++ version 4.1.2 Output: Code:
Regards, Dave Last edited by davekw7x : 20-Mar-2010 at 14:11.
|
Recent GIDBlog
Vista ?Widgets? on Windows XP by LocalTech
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problem executing nam-1.13 | RodolfoAlvizu | Computer Software Forum - Linux | 20 | 28-Feb-2009 15:23 |
| Linked Lists advice request | promsan | C Programming Language | 74 | 23-May-2007 08:29 |
| conversion member function question | amad1337 | C++ Forum | 1 | 13-Jun-2006 20:21 |
| conversion double to float | donaldk | C Programming Language | 5 | 12-Feb-2006 23:16 |
| C Currency Conversion program help needed | mutt | C Programming Language | 1 | 13-Jun-2004 15:14 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The