Click here to Skip to main content
15,921,174 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: How to implement WndProc callback method in a windows service ? Pin
Adam Roderick J21-Oct-09 22:00
Adam Roderick J21-Oct-09 22:00 
AnswerRe: How to implement WndProc callback method in a windows service ? Pin
Kushagra Tiwari21-Oct-09 22:08
Kushagra Tiwari21-Oct-09 22:08 
GeneralRe: How to implement WndProc callback method in a windows service ? Pin
Adam Roderick J21-Oct-09 23:32
Adam Roderick J21-Oct-09 23:32 
GeneralRe: How to implement WndProc callback method in a windows service ? Pin
Iain Clarke, Warrior Programmer21-Oct-09 23:34
Iain Clarke, Warrior Programmer21-Oct-09 23:34 
GeneralRe: How to implement WndProc callback method in a windows service ? Pin
Kushagra Tiwari22-Oct-09 0:35
Kushagra Tiwari22-Oct-09 0:35 
Questioncan i store output from readdir() function in an array Pin
WindowsVsLinux21-Oct-09 21:23
WindowsVsLinux21-Oct-09 21:23 
AnswerRe: can i store output from readdir() function in an array Pin
«_Superman_»21-Oct-09 21:30
professional«_Superman_»21-Oct-09 21:30 
GeneralRe: can i store output from readdir() function in an array Pin
WindowsVsLinux21-Oct-09 21:43
WindowsVsLinux21-Oct-09 21:43 
GeneralRe: can i store output from readdir() function in an array Pin
Cedric Moonen21-Oct-09 21:57
Cedric Moonen21-Oct-09 21:57 
GeneralRe: can i store output from readdir() function in an array Pin
WindowsVsLinux21-Oct-09 22:05
WindowsVsLinux21-Oct-09 22:05 
GeneralRe: can i store output from readdir() function in an array Pin
Cedric Moonen21-Oct-09 22:14
Cedric Moonen21-Oct-09 22:14 
GeneralRe: can i store output from readdir() function in an array Pin
WindowsVsLinux21-Oct-09 22:18
WindowsVsLinux21-Oct-09 22:18 
GeneralRe: can i store output from readdir() function in an array Pin
Michael Schubert21-Oct-09 22:56
Michael Schubert21-Oct-09 22:56 
GeneralRe: can i store output from readdir() function in an array Pin
David Crow22-Oct-09 3:21
David Crow22-Oct-09 3:21 
QuestionType Promotion in C Pin
__yash__21-Oct-09 20:36
professional__yash__21-Oct-09 20:36 
AnswerRe: Type Promotion in C Pin
«_Superman_»21-Oct-09 21:28
professional«_Superman_»21-Oct-09 21:28 
GeneralRe: Type Promotion in C Pin
__yash__21-Oct-09 21:36
professional__yash__21-Oct-09 21:36 
QuestionRe: Type Promotion in C Pin
CPallini21-Oct-09 21:39
mveCPallini21-Oct-09 21:39 
AnswerRe: Type Promotion in C Pin
__yash__21-Oct-09 21:50
professional__yash__21-Oct-09 21:50 
AnswerRe: Type Promotion in C Pin
__yash__21-Oct-09 21:59
professional__yash__21-Oct-09 21:59 
GeneralRe: Type Promotion in C [modified] Pin
CPallini21-Oct-09 22:01
mveCPallini21-Oct-09 22:01 
GeneralRe: Type Promotion in C [modified] Pin
__yash__21-Oct-09 22:25
professional__yash__21-Oct-09 22:25 
In the book C-The Complete Reference by Herbert Schildt theree is an example
char ch;
int i;
float f
double d;
result=(ch/i)+(f*d)-(f+i)


Here it does not talk about the data type of the variable "result". In any case, the conversion here is as follows: First ch is converted to int since i is int, then ch/i is performed. The result of ch/i is then converted to double as f*d is double. The final value is a double.

Now if "result" is type float then the final value will be truncated to float and stored in "result", isnt it?
CPallini wrote:
types promotion occurs because of (in the original expressio) the assignment was done to an integer.


As we see in the above example the variable to which the final value is assigned, its type matters only when we have solved the expression on the right side.

Please correct me if wrong anywhere.


The mentioned book also says:
"First, all char and short int values are automatically elevated to int"
This seems to be the reason why I don't lose the shifted out bits and also because I store the value back in an unsigned long Smile | :)

modified on Thursday, October 22, 2009 4:51 AM

GeneralRe: Type Promotion in C Pin
CPallini21-Oct-09 22:52
mveCPallini21-Oct-09 22:52 
GeneralRe: Type Promotion in C Pin
CPallini21-Oct-09 22:59
mveCPallini21-Oct-09 22:59 
GeneralRe: Type Promotion in C Pin
__yash__21-Oct-09 23:12
professional__yash__21-Oct-09 23:12 

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.