Seventh Week on-board practical Project 2--GUI program development

Source: Internet
Author: User

Effect


This is a very brief calculator ....

Put the code.

Class.h

Class List{public:list () {a = 1; b = 1; e = ' + ';} List (double x, CString p, double y): A (x), E (P), B (y) {}double calculate (void);p rivate:double A, B; CString e;};

Howcalcu.cpp

#include "stdafx.h" #include "class.h" double list::calculate (void) {if (E = = ' + ') return a + b;if (e = = '-') return a-b;if ( E = = ' * ') return a*b;if (E = = '/') return a/b;}

I want to talk about the changes to char variables in VS2013

In VS2013, the string type is only CString


The original char, string, etc. are all set in this variable, so I came from C + + and it's hard to adapt ....

For example, I want to use Swich can not use, only if judged, is still in the study

So I used the stupidest method of defining variables directly with CString to finally solve the problem.

The rest is not a problem, mainly the CString of the non-adaptation ...

Seventh Week on-board practical Project 2--GUI program development

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.