Click here to Skip to main content
15,880,725 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: [ win32 ][ code::block's ] game 1 error ? Pin
Richard MacCutchan26-Oct-17 0:16
mveRichard MacCutchan26-Oct-17 0:16 
GeneralRe: [ win32 ][ code::block's ] game 1 error ? Pin
bluatigro30-Oct-17 23:50
bluatigro30-Oct-17 23:50 
GeneralRe: [ win32 ][ code::block's ] game 1 error ? Pin
Richard MacCutchan31-Oct-17 0:13
mveRichard MacCutchan31-Oct-17 0:13 
QuestionCDBVariant type problem Pin
_Flaviu25-Oct-17 2:06
_Flaviu25-Oct-17 2:06 
QuestionRe: CDBVariant type problem Pin
Richard MacCutchan25-Oct-17 2:34
mveRichard MacCutchan25-Oct-17 2:34 
AnswerRe: CDBVariant type problem Pin
_Flaviu25-Oct-17 4:43
_Flaviu25-Oct-17 4:43 
GeneralRe: CDBVariant type problem Pin
Richard MacCutchan25-Oct-17 6:19
mveRichard MacCutchan25-Oct-17 6:19 
GeneralRe: CDBVariant type problem Pin
leon de boer25-Oct-17 8:42
leon de boer25-Oct-17 8:42 
What you have described sounds perfectly correct depending how you set the tables up.

Your nUser will be (look at SQL spec integer value between the range 2^ -31 and 2^31 -1) which is 32 bits or 4 bytes and would be a long in C/C++.
Your decimal (10.2) will be stored as an IEEE-754/-854-compliant bit string which will be 5-17 bytes.

If you stored your decimal(10.2) as singles/doubles you would get issues when you added them etc the small fractions you can't see would roll do you understand lets add 3 digits with 3 decimal places

Stored .... 10.2 format
-------------------------
1.344 .... 1.34
2.364 .... 2.36
1.134 .... 1.13
----------------------
4.842 .... 4.83

See the Problem 4.842 down to 2 digits is 4.84 and is not right answer they don't give same result and that is why SQL does not automatically covert numbers with precision.

I am sure if you make a table of doubles, single or floats they will come back as that just don't expect that from decimal, numeric which will be strings
In vino veritas


modified 25-Oct-17 15:22pm.

PraiseRe: CDBVariant type problem Pin
_Flaviu26-Oct-17 20:42
_Flaviu26-Oct-17 20:42 
QuestionRe: CDBVariant type problem Pin
David Crow25-Oct-17 3:01
David Crow25-Oct-17 3:01 
PraiseRe: CDBVariant type problem Pin
_Flaviu25-Oct-17 4:23
_Flaviu25-Oct-17 4:23 
AnswerRe: CDBVariant type problem Pin
Randor 25-Oct-17 16:30
professional Randor 25-Oct-17 16:30 
AnswerRe: CDBVariant type problem Pin
Victor Nijegorodov26-Oct-17 10:06
Victor Nijegorodov26-Oct-17 10:06 
Questionc Pin
Member 1348311524-Oct-17 7:24
Member 1348311524-Oct-17 7:24 
AnswerRe: c Pin
Chris Losinger24-Oct-17 7:51
professionalChris Losinger24-Oct-17 7:51 
Rant[REPOST] c Pin
Richard Deeming24-Oct-17 9:46
mveRichard Deeming24-Oct-17 9:46 
Questionalgorithm for an optimization problem Pin
Member 1347898622-Oct-17 9:31
Member 1347898622-Oct-17 9:31 
AnswerRe: algorithm for an optimization problem Pin
OriginalGriff22-Oct-17 9:32
mveOriginalGriff22-Oct-17 9:32 
GeneralRe: algorithm for an optimization problem Pin
Member 1347898622-Oct-17 10:08
Member 1347898622-Oct-17 10:08 
GeneralRe: algorithm for an optimization problem Pin
OriginalGriff22-Oct-17 10:16
mveOriginalGriff22-Oct-17 10:16 
PraiseRe: algorithm for an optimization problem Pin
David Crow22-Oct-17 16:45
David Crow22-Oct-17 16:45 
GeneralRe: algorithm for an optimization problem Pin
Bram van Kampen22-Oct-17 17:40
Bram van Kampen22-Oct-17 17:40 
AnswerRe: algorithm for an optimization problem Pin
CPallini22-Oct-17 22:17
mveCPallini22-Oct-17 22:17 
AnswerRe: algorithm for an optimization problem Pin
jschell23-Oct-17 7:28
jschell23-Oct-17 7:28 
QuestionCMonthCalCtrlDlg and the 2038 problem Pin
Member 1345973322-Oct-17 6:13
Member 1345973322-Oct-17 6:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.