| | |
Looking for _gcvt(double,int,string)
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
I found this neat little GUI calculator program on the net.
It uses a function called _gcvt(double val,int limit,string cBuf), which seems to be used to convert a double val to a string cBuf, with some formatting and limiting.
I replaced it with sprintf(), but the output looks rather crude to the perfectionist.
xfind.exe can find _gcvt in a few header files, but Dev C++ does not respond to it. Does anybody have some past experience with it?
It uses a function called _gcvt(double val,int limit,string cBuf), which seems to be used to convert a double val to a string cBuf, with some formatting and limiting.
I replaced it with sprintf(), but the output looks rather crude to the perfectionist.
xfind.exe can find _gcvt in a few header files, but Dev C++ does not respond to it. Does anybody have some past experience with it?
May 'the Google' be with you!
>2.3 + 3.4 = 5.700000000 looks silly!
You can specify a precision with sprintf:
You can specify a precision with sprintf:
C++ Syntax (Toggle Plain Text)
sprintf ( cBuf, "%.*f", limit, val );
I'm here to prove you wrong.
•
•
•
•
Originally Posted by Narue
>2.3 + 3.4 = 5.700000000 looks silly!
You can specify a precision with sprintf:
C++ Syntax (Toggle Plain Text)
sprintf ( cBuf, "%.*f", limit, val );
May 'the Google' be with you!
![]() |
Similar Threads
- Escape Sequences or Accepting Double Quotes in String Constants (Visual Basic 4 / 5 / 6)
- convert string to double, and result is string again (Java)
- convert int to string (C)
Other Threads in the C++ Forum
- Previous Thread: Towers of Hanoi
- Next Thread: structures and functions woohoo!
| Thread Tools | Search this Thread |
api array based beginner binary bitmap c++ c/c++ calculator char char* class classes code compile compiler console conversion count delete deploy desktop directshow dll download dynamic dynamiccharacterarray encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux list loop looping loops map math matrix memory news node numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference return rpg sorting string strings struct temperature template templates test text text-file tree unix url variable vector visualstudio win32 windows winsock word wordfrequency wxwidgets






