Visual c ++ programming (Wang mingfu,) Chapter 4.2 ___ development of error c2065: 'updatedisplay' in mycalculator Program

Source: Internet
Author: User

A. In mycalculatordlg. H, add the definition Declaration for the functions calculate () and updatedisplay:

Afx_msg void calculate ();

Afxmsg void updatedisplay (double lval );

Added successfully as follows:

// {Afx_msg (cmycalculatordlg)
Virtual bool oninitdialog ();
Afx_msg void onsyscommand (uint NID, lparam );
Afx_msg void onpaint ();
Afx_msg hcursor onquerydragicon ();
Afx_msg void onbutton0 ();
Afx_msg void onbutton1 ();
Afx_msg void onbutton2 ();
Afx_msg void onbutton3 ();
Afx_msg void onbutton4 ();
Afx_msg void onbutton5 ();
Afx_msg void onbutton6 ();
Afx_msg void onbutton7 ();
Afx_msg void onbutton8 ();
Afx_msg void onbutton9 ();
Afx_msg void onbuttonadd ();
Afx_msg void onbuttonclear ();
Afx_msg void onbuttondiv ();
Afx_msg void onbuttonequal ();
Afx_msg void onbuttonminus ();
Afx_msg void onbuttonmutiply ();
Afx_msg void onbuttonreciprocal ();
Afx_msg void onbuttonpoint ();
Afx_msg void onbuttonsign ();
Afx_msg void onbuttonsqrt ();
Afx_msg void calculate ();
Afx_msg void updatedisplay (double lval );
//} Afx_msg

B. Error c2065: 'fabs ': Undeclared identifier

Error c2065: 'sqrt ': Undeclared identifier

Add the header file in mycalculator. cpp:

# Include "math. H"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.