| | |
warning C4244: 'argument' : conversion from 'double' to 'char', possible loss of data
![]() |
•
•
Join Date: Jul 2005
Posts: 6
Reputation:
Solved Threads: 0
warning C4244: 'argument' : conversion from 'double' to 'char', possible loss of data
0
#1 Aug 5th, 2005
Can anyone help me convert char to double. Yes, I tried casting, it did not work. Anyway, this is the problem, the variable is declared as type double in the struct(database structure). However, it is defined as type Text in the class I'm modifying.
The variable in the class I'm using must remain that type because it is used by other functions in the class. Please help
Nis
The variable in the class I'm using must remain that type because it is used by other functions in the class. Please help
Nis
•
•
Join Date: Jul 2005
Posts: 1,673
Reputation:
Solved Threads: 261
Re: warning C4244: 'argument' : conversion from 'double' to 'char', possible loss of data
0
#2 Aug 5th, 2005
Type Text is probably a string of some sort, rather than type char per se'. This then becomes similar to converting type int to a string, whcih may be in a FAQ somewhere. In any event, I'd try using a stringstream (C++ style) or sprintf() (C style) to convert the double to a string and then convert the string to type Text, if necessary.
Re: warning C4244: 'argument' : conversion from 'double' to 'char', possible loss of
0
#3 Aug 5th, 2005
•
•
•
•
Originally Posted by webempress
Can anyone help me convert char to double. Yes, I tried casting, it did not work.
http://www.parashift.com/c++-faq-lit....html#faq-39.1
"One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
•
•
Join Date: Jul 2005
Posts: 6
Reputation:
Solved Threads: 0
Re: warning C4244: 'argument' : conversion from 'double' to 'char', possible loss of data
0
#4 Aug 5th, 2005
Re: warning C4244: 'argument' : conversion from 'double' to 'char', possible loss of
0
#5 Aug 5th, 2005
•
•
•
•
Originally Posted by webempress
Thanks for the advice and I will not bash casting (cause it does and excellent job) but for this program its not the solution. It solves the run time warnings but logically, it does not generate the likely response.
•
•
•
•
Originally Posted by webempress
Do you have any more ides.
•
•
•
•
Originally Posted by webempress
Thanks for the advice and I will not bash casting (cause it does and excellent job)
"One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
![]() |
Similar Threads
- build problems (C)
- VS compiler error??? (C++)
- help needed with errors (C++)
- Trouble Converting Variables (C++)
- Brain Dead Night (C++)
Other Threads in the C Forum
- Previous Thread: laern c seriously
- Next Thread: Need help with C program
| Thread Tools | Search this Thread |
* adobe ansi api array arrays binarysearch calculate centimeter char cm convert copyanyfile copypdffile cprogramme createcopyoffile createprocess() csyntax directory dynamic feet fflush file floatingpointvalidation fork forloop frequency getlasterror getlogicaldrivestrin givemetehcodez global graphics gtkgcurlcompiling gtkwinlinux hacking hardware highest homework i/o inches incrementoperators intmain() iso km linked linkedlist linux linuxsegmentationfault list locate logical_drives loopinsideloop. match matrix microsoft motherboard mqqueue mysql oddnumber odf open opendocumentformat openwebfoundation pattern pdf performance pointer posix power program programming pyramidusingturboccodes read recursion recv recvblocked repetition reversing scanf scheduling segmentationfault send shape single socketprograming socketprogramming stack standard strchr string suggestions test unix urboc user variable voidmain() whythiscodecausesegmentationfault win32api windows.h






