Click here to Skip to main content
15,560,618 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: [ win32 ][ code::block's ] game 1 error ? Pin
Richard MacCutchan26-Oct-17 1:16
mveRichard MacCutchan26-Oct-17 1:16 
GeneralRe: [ win32 ][ code::block's ] game 1 error ? Pin
bluatigro31-Oct-17 0:50
bluatigro31-Oct-17 0:50 
GeneralRe: [ win32 ][ code::block's ] game 1 error ? Pin
Richard MacCutchan31-Oct-17 1:13
mveRichard MacCutchan31-Oct-17 1:13 
QuestionCDBVariant type problem Pin
_Flaviu25-Oct-17 3:06
_Flaviu25-Oct-17 3:06 
QuestionRe: CDBVariant type problem Pin
Richard MacCutchan25-Oct-17 3:34
mveRichard MacCutchan25-Oct-17 3:34 
AnswerRe: CDBVariant type problem Pin
_Flaviu25-Oct-17 5:43
_Flaviu25-Oct-17 5:43 
GeneralRe: CDBVariant type problem Pin
Richard MacCutchan25-Oct-17 7:19
mveRichard MacCutchan25-Oct-17 7:19 
GeneralRe: CDBVariant type problem Pin
leon de boer25-Oct-17 9:42
leon de boer25-Oct-17 9: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 21:42
_Flaviu26-Oct-17 21:42 
QuestionRe: CDBVariant type problem Pin
David Crow25-Oct-17 4:01
David Crow25-Oct-17 4:01 
PraiseRe: CDBVariant type problem Pin
_Flaviu25-Oct-17 5:23
_Flaviu25-Oct-17 5:23 
AnswerRe: CDBVariant type problem Pin
Randor 25-Oct-17 17:30
professional Randor 25-Oct-17 17:30 
AnswerRe: CDBVariant type problem Pin
Victor Nijegorodov26-Oct-17 11:06
Victor Nijegorodov26-Oct-17 11:06 
Questionc Pin
Member 1348311524-Oct-17 8:24
Member 1348311524-Oct-17 8:24 
AnswerRe: c Pin
Chris Losinger24-Oct-17 8:51
professionalChris Losinger24-Oct-17 8:51 
Rant[REPOST] c Pin
Richard Deeming24-Oct-17 10:46
mveRichard Deeming24-Oct-17 10:46 
Questionalgorithm for an optimization problem Pin
Member 1347898622-Oct-17 10:31
Member 1347898622-Oct-17 10:31 
AnswerRe: algorithm for an optimization problem Pin
OriginalGriff22-Oct-17 10:32
mveOriginalGriff22-Oct-17 10:32 
GeneralRe: algorithm for an optimization problem Pin
Member 1347898622-Oct-17 11:08
Member 1347898622-Oct-17 11:08 
GeneralRe: algorithm for an optimization problem Pin
OriginalGriff22-Oct-17 11:16
mveOriginalGriff22-Oct-17 11:16 
PraiseRe: algorithm for an optimization problem Pin
David Crow22-Oct-17 17:45
David Crow22-Oct-17 17:45 
GeneralRe: algorithm for an optimization problem Pin
Bram van Kampen22-Oct-17 18:40
Bram van Kampen22-Oct-17 18:40 
AnswerRe: algorithm for an optimization problem Pin
CPallini22-Oct-17 23:17
mveCPallini22-Oct-17 23:17 
AnswerRe: algorithm for an optimization problem Pin
jschell23-Oct-17 8:28
jschell23-Oct-17 8:28 
QuestionCMonthCalCtrlDlg and the 2038 problem Pin
Member 1345973322-Oct-17 7:13
Member 1345973322-Oct-17 7: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.