|
A good help would be if you have posted the line where the error occurs.
However, the error states that you are calling the pow function with the first argument being a float , and the second one being a double . But there is no overload of the pow function for these argument types. You should cast one value to the type of the other:
float f1 = 2.0;
double f2 = 3.0;
double f3 = pow(static_cast<double>(f1), f2);
A general note:
If you did not need the float type for a specific reason (usually memory), you should consider to always use double .
|
|
|
|
|
Thank you for your helpful correction. If I change all 'float' type to double, my program would be too large.
How about change all types to 'float' ?
Thanks
|
|
|
|
|
Changing all float to double in a program would not increase the size too much. Only the size of static and initialized floating point values is doubled. During runtime, the size of dynamically allocated values (arrays) is doubled.
You may use float if you are sure that the precision is sufficient. This depends on the operations performed and the required accuracy.
I added the note to better use double because you are using the pow() function. If you add the return value to other values like in polynomial functions, there may be inexact results when using float .
|
|
|
|
|
thank you, really helped me.
|
|
|
|
|
i have IDD_mainmenu as default created by VS2010 . When I click a File in mainmenu with handle click and call another Dialog . It is alright . But when I create a button and create class for that dialog to handle click button event . When I click , no thing happen ! . I have try and Ask many but rare people know
http://www.mediafire.com/?2gwt06lg3sd794m
When run , click on HERE and then Button1 . After click no thing happen even when program handler event to show the message .
I test and find no error but it does not do .
Thank you .
hi world
|
|
|
|
|
Step 1. Cut lines 154 - 177 (inc) from 2.cpp
Step 2. Paste to bottom of 2.h
Step 3. Copy lines 175 and 176 from 2.cpp
Step 4. Replace lines 134 and 135 in 2View.cpp with the text copied in step 3
In a nutshell:
When the Help->About menu option was selected, a variable of type CAboutDlg was instanced and then had the DoModal member function called.
However, when the Here->1.1 menu option was selected, you were loading a CDialog with the appearance of the About dialog - that is to say, the resource was not hooked up to a class object of the correct type, so it could not fire the handler for the Button1 button.
Step 1&2: Move class definition for CAboutDlg to 2.h
Step 3&4: Instance correct object (CAboutDlg, not CDialog)
|
|
|
|
|
Hi
I have done like you had showed .
http://www.mediafire.com/?tra9l1xoh04qwah[^]
And still nothing done ! .
Thank you
Can you show me basically the way to make it work ? . Thank you a lot . Have nice day .
hi world
|
|
|
|
|
Not quite there yet...
You didn't replace the code for CMyView::OnHere1
Copy the code from CMy2App::OnAppAbout and replace the code for CMyView::OnHere1 with it.
|
|
|
|
|
|
why the code of game is not show
|
|
|
|
|
rucha warade wrote: why the code of game is not show
What does this mean; please explain your problem clearly?
[edit]As this is your first question on this site, I suggest you read HOW-TO-ASK-A-QUESTION[^].
[/edit]
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
You've lost the game[^].
"Real men drive manual transmission" - Rajesh.
|
|
|
|
|
Mystical Superpowers, I believe.
It is the same magic we should use to guess your scenario, I suppose.
Veni, vidi, vici.
|
|
|
|
|
Hi all,
Cant we hide a CLabelControl after declaring a variable..???
I am getting a run time error for this.
Test.h
CLabelControl m_Test;
Test.cpp
DDX_Control(pDX, IDC_LABEL_TEST, m_Test);
BOOL CExampleDlg::OnInitDialog()
{
CLabelControl* lTest;
lTest=(CLabelControl*)GetDlgItem(IDC_LABEL_TEST);
lTest->ShowWindow(SW_HIDE);
return true;
}
If i comment
//CLabelControl m_Test; in Test.h
//DDX_Control(pDX, IDC_LABEL_TEST, m_Test); in Test.pp
Then it runs without any error.
Can anyone have any idea
Thanks in Advance
Sharan
|
|
|
|
|
Your label control does not exist at the point you are trying to hide it.
You need to call CDialog::OnInitDialog in your OnInitDialog method before the control exists.
BOOL CExampleDlg::OnInitDialog()
{
CDialog::OnInitDialog();
CLabelControl* lTest;
lTest=(CLabelControl*)GetDlgItem(IDC_LABEL_TEST);
lTest->ShowWindow(SW_HIDE);
return true;
}
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
Dear all,
can any one provide me the "C source code for A* algorithm"
|
|
|
|
|
|
Dear Friend,
From my PC, I have to read the text file from another PC(server PC).
After that i have to invoke one "EXE" (application) present in that same PC(Server PC).
Then i have to send the information what i have read from that file to this application.
Kindly help me.
|
|
|
|
|
Are both PCs on the same network and able to share disks? If so you can just read the file and execute the program from the server's shared disk.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
hi all,
can anybody help me to extract plain text from html file?
thanks.
|
|
|
|
|
A very simple parser would:
- Get the used character set from the header
- Locate the next < char, locate the next > char behind, and delete all in between.
- Replace the HTML entities &, <, >, and " by the corresponding chars &, < >, and ".
- Optional replace other entities by the corresponding characters according to the used character set.
- Optional replace Unicode code points (&#[x]cp;) by the corresponding characters according to the used character set.
- Optional convert the resulting text to the required output character set
|
|
|
|
|
I need to convert my programs from c++ 6 to Visual stutio professional 2010.
Please advise how to proceed and what I need to fix typically ? What is the best way to do this ?
Thanks
Ruilin
|
|
|
|
|
This link will help you[^]
Every new day is another chance to change your life.
|
|
|
|
|
thanks a lot. Do I have to install visual studio 2008 for converting my visual c++ 6 (2003) ?
Please give me some guidances.
hanks again
|
|
|
|