Click here to Skip to main content
15,903,362 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generaldifference between CComPtr <ipin> and IPin*</ipin> Pin
hanlei00000000093-Mar-08 2:56
hanlei00000000093-Mar-08 2:56 
GeneralRe: difference between CComPtr and IPin* Pin
CPallini3-Mar-08 3:12
mveCPallini3-Mar-08 3:12 
GeneralRe: difference between CComPtr and IPin* Pin
Alexander M.,3-Mar-08 3:27
Alexander M.,3-Mar-08 3:27 
GeneralRe: difference between CComPtr and IPin* Pin
CPallini3-Mar-08 3:47
mveCPallini3-Mar-08 3:47 
QuestionProblem while convesion from Float to int using VC++ 6.0 Pin
Kishore JP3-Mar-08 2:55
Kishore JP3-Mar-08 2:55 
GeneralRe: Problem while convesion from Float to int using VC++ 6.0 Pin
David Crow3-Mar-08 3:02
David Crow3-Mar-08 3:02 
GeneralRe: Problem while convesion from Float to int using VC++ 6.0 Pin
CPallini3-Mar-08 3:06
mveCPallini3-Mar-08 3:06 
GeneralRe: Problem while convesion from Float to int using VC++ 6.0 Pin
jhwurmbach3-Mar-08 3:09
jhwurmbach3-Mar-08 3:09 
Kishore JP wrote:
float nAngle = (float)(angle / 10) - 2;

(angle / 10) is first computed as integer, and the integer-result is converted to a float. Subsequently, an integer 2 is subtracted, thereby being inplicitly converted to a 2.0 float.
The resulting float is assigned to nAngle.

Kishore JP wrote:
float nAngulationStep = (float)angul_step / 100;


A integer-division of angul_step by (integer)100 is done, and the (integer)result is convertetd to a float.

Kishore JP wrote:
float nFrames = (int)(nAngle/nAngulationStep);


A float-division is done, its decimals are thrown away (that is: rounded down) and the result is implicitly converted into a float.

Numerics in C/C++ require you to really know what you want to do. If you want to divide by a float-constant, you really must write a float into your code (as the others already showed you)!

B.T.W. Why do you use float?
Do your math in double and round when you need it (e.g. when handing coordinates over to OpenGL)
If you really must use warting (e.g. writing nAngle instead of simply Angle), which is completely obsolete in the days of IDEs and Intellisense, please do it meaningful, and distinguish integers and decimal values.

Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all.
Douglas Adams, "Dirk Gently's Holistic Detective Agency"

AnswerRe: Problem while convesion from Float to int using VC++ 6.0 Pin
Kishore JP16-Mar-08 1:20
Kishore JP16-Mar-08 1:20 
GeneralRe: Problem while convesion from Float to int using VC++ 6.0 Pin
jhwurmbach16-Mar-08 22:19
jhwurmbach16-Mar-08 22:19 
Generalprocesses Pin
duta3-Mar-08 2:16
duta3-Mar-08 2:16 
QuestionRe: processes Pin
David Crow3-Mar-08 3:06
David Crow3-Mar-08 3:06 
GeneralRe: processes Pin
Hamid_RT3-Mar-08 21:06
Hamid_RT3-Mar-08 21:06 
QuestionCANCEL BUTTON Pin
Adnan Merter3-Mar-08 1:17
Adnan Merter3-Mar-08 1:17 
QuestionRe: CANCEL BUTTON Pin
CPallini3-Mar-08 2:59
mveCPallini3-Mar-08 2:59 
QuestionRe: CANCEL BUTTON Pin
David Crow3-Mar-08 3:07
David Crow3-Mar-08 3:07 
QuestionRe: CANCEL BUTTON Pin
Adnan Merter3-Mar-08 3:57
Adnan Merter3-Mar-08 3:57 
GeneralRe: CANCEL BUTTON Pin
David Crow3-Mar-08 4:18
David Crow3-Mar-08 4:18 
GeneralRe: CANCEL BUTTON Pin
Randor 3-Mar-08 4:29
professional Randor 3-Mar-08 4:29 
GeneralDebugBreak Pin
George_George3-Mar-08 1:08
George_George3-Mar-08 1:08 
GeneralRe: DebugBreak Pin
Matthew Faithfull3-Mar-08 1:19
Matthew Faithfull3-Mar-08 1:19 
GeneralRe: DebugBreak Pin
George_George3-Mar-08 1:36
George_George3-Mar-08 1:36 
GeneralRe: DebugBreak Pin
Matthew Faithfull3-Mar-08 2:18
Matthew Faithfull3-Mar-08 2:18 
GeneralRe: DebugBreak Pin
George_George3-Mar-08 2:26
George_George3-Mar-08 2:26 
GeneralRe: DebugBreak Pin
Stephen Hewitt3-Mar-08 2:18
Stephen Hewitt3-Mar-08 2:18 

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.