Click here to Skip to main content
15,895,011 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: CreateFile question Pin
Mircea Puiu16-Aug-06 23:06
Mircea Puiu16-Aug-06 23:06 
QuestionInclude Files and Folder Structure Pin
pgav16-Aug-06 3:28
pgav16-Aug-06 3:28 
AnswerRe: Include Files and Folder Structure Pin
Chris Losinger16-Aug-06 3:32
professionalChris Losinger16-Aug-06 3:32 
AnswerRe: Include Files and Folder Structure Pin
Cedric Moonen16-Aug-06 3:32
Cedric Moonen16-Aug-06 3:32 
GeneralRe: Include Files and Folder Structure Pin
pgav16-Aug-06 3:33
pgav16-Aug-06 3:33 
GeneralRe: Include Files and Folder Structure Pin
Zac Howland16-Aug-06 3:36
Zac Howland16-Aug-06 3:36 
QuestionPasswordDerivedBytes How To? Pin
Gywox16-Aug-06 3:00
Gywox16-Aug-06 3:00 
QuestionHow to send double value as 8 uint8 values? Pin
cahit2316-Aug-06 2:55
cahit2316-Aug-06 2:55 
Hi all,

I am currently working on Serial Interface between a control box and PC and want to send/receive double values from Pc to the box as 8 uint8 values since the box only accepts in uint8 form.

For that i thought as follows : to get that double value (64 bits) in binary form and get the last 8 bits with &(and) operator and shifting bits to right till all bits are finished,namely :

double var;
char var2send[8]; % in array

var2send[0]= var & 0x00000000000000ff % last 8 bits with & operator
var>>8; %shifting bits
var2send[1]= var & 0x00000000000000ff
var>>8;
.
. % and sending this array as output
.
But in this code, i received an error that says i cant use double with & operators so that must be converted 64 bit long form.Besides, cast function rounds my double value to the nearest integer even if i type number like 23.34353 with precision.

How can i manage to do this?? or anyone has better way or suggestion?

I hope i could clearly explain my problem.

I would be very pleased if you could help me!

Thanks a lot!

Cahit

QuestionRe: How to send double value as 8 uint8 values? Pin
David Crow16-Aug-06 3:09
David Crow16-Aug-06 3:09 
AnswerRe: How to send double value as 8 uint8 values? Pin
Steve S16-Aug-06 3:13
Steve S16-Aug-06 3:13 
GeneralRe: How to send double value as 8 uint8 values? Pin
David Crow16-Aug-06 3:15
David Crow16-Aug-06 3:15 
GeneralRe: How to send double value as 8 uint8 values? Pin
kakan16-Aug-06 3:43
professionalkakan16-Aug-06 3:43 
GeneralRe: How to send double value as 8 uint8 values? Pin
Zac Howland16-Aug-06 4:20
Zac Howland16-Aug-06 4:20 
AnswerRe: How to send double value as 8 uint8 values? Pin
Chris Losinger16-Aug-06 3:35
professionalChris Losinger16-Aug-06 3:35 
Questionproblem with FTP client Pin
vijay_aroli16-Aug-06 2:53
vijay_aroli16-Aug-06 2:53 
QuestionFaxRegisterRoutingExtension Fails on Windows XP! Pin
a_kiani16-Aug-06 2:43
a_kiani16-Aug-06 2:43 
AnswerRe: FaxRegisterRoutingExtension Fails on Windows XP! Pin
Hamid_RT18-Aug-06 8:02
Hamid_RT18-Aug-06 8:02 
Questionabout timestamp Pin
George_George16-Aug-06 2:42
George_George16-Aug-06 2:42 
AnswerRe: about timestamp Pin
David Crow16-Aug-06 2:49
David Crow16-Aug-06 2:49 
GeneralRe: about timestamp Pin
George_George16-Aug-06 19:29
George_George16-Aug-06 19:29 
GeneralRe: about timestamp Pin
David Crow17-Aug-06 3:10
David Crow17-Aug-06 3:10 
GeneralRe: about timestamp Pin
George_George17-Aug-06 22:52
George_George17-Aug-06 22:52 
GeneralRe: about timestamp Pin
David Crow18-Aug-06 2:53
David Crow18-Aug-06 2:53 
GeneralRe: about timestamp Pin
George_George18-Aug-06 21:33
George_George18-Aug-06 21:33 
QuestionUndefined operator? Pin
Skippums16-Aug-06 1:59
Skippums16-Aug-06 1:59 

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.