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