Click here to Skip to main content
15,899,563 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: taylor formula Pin
malaugh21-Mar-08 9:04
malaugh21-Mar-08 9:04 
QuestionRe: taylor formula Pin
CPallini21-Mar-08 10:40
mveCPallini21-Mar-08 10:40 
GeneralOpening terminal windows from command line app Pin
malaugh21-Mar-08 7:16
malaugh21-Mar-08 7:16 
AnswerRe: Opening terminal windows from command line app Pin
Rajkumar R21-Mar-08 9:22
Rajkumar R21-Mar-08 9:22 
GeneralRe: Opening terminal windows from command line app Pin
malaugh21-Mar-08 10:24
malaugh21-Mar-08 10:24 
QuestionRe: Opening terminal windows from command line app Pin
David Crow21-Mar-08 10:41
David Crow21-Mar-08 10:41 
GeneralRe: Opening terminal windows from command line app Pin
malaugh21-Mar-08 11:54
malaugh21-Mar-08 11:54 
QuestionWindows file sharing Pin
Member 241965021-Mar-08 4:21
Member 241965021-Mar-08 4:21 
QuestionRe: Windows file sharing Pin
David Crow21-Mar-08 4:30
David Crow21-Mar-08 4:30 
GeneralRe: Windows file sharing Pin
Member 241965025-Mar-08 10:43
Member 241965025-Mar-08 10:43 
GeneralNaming suggestion Pin
Capitanevs21-Mar-08 2:59
Capitanevs21-Mar-08 2:59 
QuestionRe: Naming suggestion Pin
David Crow21-Mar-08 3:13
David Crow21-Mar-08 3:13 
GeneralRe: Naming suggestion [modified] Pin
Rajkumar R21-Mar-08 3:38
Rajkumar R21-Mar-08 3:38 
GeneralRe: Naming suggestion Pin
Capitanevs21-Mar-08 4:43
Capitanevs21-Mar-08 4:43 
GeneralRe: Naming suggestion Pin
Capitanevs21-Mar-08 5:46
Capitanevs21-Mar-08 5:46 
GeneralRe: Naming suggestion Pin
David Crow21-Mar-08 5:59
David Crow21-Mar-08 5:59 
GeneralRe: Naming suggestion Pin
Rajkumar R21-Mar-08 9:45
Rajkumar R21-Mar-08 9:45 
GeneralRe: Naming suggestion Pin
Capitanevs22-Mar-08 6:15
Capitanevs22-Mar-08 6:15 
Generalcannot typecast short datatype to long datatype Pin
Member 447883321-Mar-08 2:55
Member 447883321-Mar-08 2:55 
GeneralRe: cannot typecast short datatype to long datatype Pin
Capitanevs21-Mar-08 3:08
Capitanevs21-Mar-08 3:08 
GeneralRe: cannot typecast short datatype to long datatype Pin
Cedric Moonen21-Mar-08 3:20
Cedric Moonen21-Mar-08 3:20 
First thing, please read the posting guidelines at the top of the forum: format the code with the <pre> tags, it is quite difficult to read right now.


Member 4478833 wrote:
I have this small snippet where 'a' is of short datatype.


That's not what you have in your code: there it is an integer, not a short. Anyway, if it is a short then your code cannot work: basically what you are doing is converting from a pointer to short to a pointer to long. A short is 2 bytes and a long is 4 bytes. So, guess what happens ? The pointer to long will 'see' two bytes more that were not initialized by the short and those of course contains garbage.

Anyway, why are you doing stuff like that ? Playing with void pointers is something that you probably want to avoid (unless you are doing plain C progrmming).

Cédric Moonen
Software developer

Charting control [v1.3]

GeneralRe: cannot typecast short datatype to long datatype Pin
Member 447883323-Mar-08 23:12
Member 447883323-Mar-08 23:12 
QuestionRe: cannot typecast short datatype to long datatype Pin
David Crow21-Mar-08 3:20
David Crow21-Mar-08 3:20 
GeneralRe: cannot typecast short datatype to long datatype Pin
CPallini21-Mar-08 6:58
mveCPallini21-Mar-08 6:58 
QuestionMapping the Windows XP APIs to Linux Pin
IamPoojaa21-Mar-08 2:17
IamPoojaa21-Mar-08 2:17 

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.