Click here to Skip to main content
15,888,461 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
I have this small snippet where 'a' is of short datatype.I am sending the address of short to one of the function ,another function returns the void pointer ,i want to typecast this void pointer to long but am not getting the right answer as 10 but it is giving garbage value.But if i type cast to short it gives proper value 10.For reference i am adding the code.
Plz reply me back as soon as possible.

#include<stdio.h>
void *temp;
void
call_func(void*);

void* ret_val();
int
main()
{
int a;
long b=0;
short* c;

a=10;

call_func(&a);
b=*((long*)ret_val()); ///if *((short*)ret_val)) gives proper value
c=ret_val();
printf("%ld\n",b);
printf("%d\n",*c);
return 0;
}

void
call_func(void* arg)
{

temp=arg;
}

void* ret_val()
{
return temp;
}





Thanks in Advance.
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 
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 
GeneralRe: Mapping the Windows XP APIs to Linux Pin
Cedric Moonen21-Mar-08 2:34
Cedric Moonen21-Mar-08 2:34 
GeneralRe: Mapping the Windows XP APIs to Linux Pin
IamPoojaa23-Mar-08 19:56
IamPoojaa23-Mar-08 19:56 
GeneralRe: Mapping the Windows XP APIs to Linux Pin
malaugh21-Mar-08 7:31
malaugh21-Mar-08 7:31 
GeneralRe: Mapping the Windows XP APIs to Linux Pin
IamPoojaa23-Mar-08 19:51
IamPoojaa23-Mar-08 19:51 
GeneralPath-parts naming conventions. Pin
Capitanevs21-Mar-08 2:05
Capitanevs21-Mar-08 2:05 
QuestionRe: Path-parts naming conventions. Pin
CPallini21-Mar-08 7:14
mveCPallini21-Mar-08 7:14 
GeneralRe: Path-parts naming conventions. Pin
Capitanevs21-Mar-08 12:39
Capitanevs21-Mar-08 12:39 
Generalpermutation test Pin
mich21-Mar-08 2:03
mich21-Mar-08 2:03 
QuestionRe: permutation test Pin
Rajesh R Subramanian21-Mar-08 2:18
professionalRajesh R Subramanian21-Mar-08 2:18 
GeneralRe: permutation test Pin
Rajkumar R21-Mar-08 2:34
Rajkumar R21-Mar-08 2:34 
General[Message Deleted] Pin
vikramlinux21-Mar-08 1:01
vikramlinux21-Mar-08 1:01 

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.