13,861,262 members

# C / C++ / MFC

 Re: Retrieve HWND of a control that has focus _Flaviu13-Aug-18 1:09 _Flaviu 13-Aug-18 1:09
 Re: Retrieve HWND of a control that has focus `Randor` 13-Aug-18 2:51 `Randor` 13-Aug-18 2:51
 Re: Retrieve HWND of a control that has focus leon de boer12-Aug-18 4:47 leon de boer 12-Aug-18 4:47
 What is the magic incantation to select a row in a CListCtrl in report mode ? Maximilien9-Aug-18 10:09 Maximilien 9-Aug-18 10:09
 Re: What is the magic incantation to select a row in a CListCtrl in report mode ? David Crow9-Aug-18 10:47 David Crow 9-Aug-18 10:47
 Re: What is the magic incantation to select a row in a CListCtrl in report mode ? Maximilien9-Aug-18 13:06 Maximilien 9-Aug-18 13:06
 Re: What is the magic incantation to select a row in a CListCtrl in report mode ? Maximilien21-Aug-18 6:11 Maximilien 21-Aug-18 6:11
 how to use recursive descent algorithm to compute an arithmetical expression? tony_ming8-Aug-18 21:42 tony_ming 8-Aug-18 21:42
 I want to use recursive descent algorithm to compute an arithmetical expression, but I can't get the right value,so please tell me how to write the code here is my grammar ```E→E+T|E-T|T T→T*F| T/F|F F→(E)|i ``` the following is my code ```
#include     #include   using namespace std;  int pos = 0;  string str = "1+2*3-4";  double E();  double T();  double F();  int main() { 	double v = E(); 	printf("%f", v); 	getchar(); 	return 0; }  double E() { 	double v = 0; 	char c = str.at(pos); 	if (c == '+') { 		pos++; 		v = E() + T(); 	} 	else if (c == '-') { 		pos++; 		v = E() - T(); 	} 	else { 		pos++; 		v = T(); 	} 	return v; }   double T() { 	double v = 0; 	char c = str.at(pos); 	if (c == '*') { 		pos++; 		v = T() * F(); 	} 	else if (c == '/') { 		pos++; 		v = T() / F(); 	} 	else { 		pos++; 		v = F(); 	} 	return v; }   double F() { 	char c = str.at(pos); 	if (c == '(') { 		pos++; 		double v = E(); 		c = str.at(pos); 		if (c == ')') { 			pos++; 			return v; 		} 	} 	else { 		string s = ""; 		while (true) { 			c = str.at(pos); 			if (c >= '0' && c <= '9') { 				s += c; 				pos++; 			} 			else { 				break; 			} 		}  		return atoi(s.c_str()); 	} 	return 0; }```modified  9-Aug-18 2:57am.
 Re: how to use recursive descent algorithm to compute an arithmetical expression? Richard MacCutchan8-Aug-18 21:50 Richard MacCutchan 8-Aug-18 21:50
 Re: how to use recursive descent algorithm to compute an arithmetical expression? Stefan_Lang8-Aug-18 23:07 Stefan_Lang 8-Aug-18 23:07
 Re: how to use recursive descent algorithm to compute an arithmetical expression? David Crow9-Aug-18 5:55 David Crow 9-Aug-18 5:55
 Re: how to use recursive descent algorithm to compute an arithmetical expression? CPallini9-Aug-18 11:38 CPallini 9-Aug-18 11:38
 MovePrev() throwing 265926 error code (End Of RowsSet). Sampath5797-Aug-18 21:19 Sampath579 7-Aug-18 21:19
 Re: MovePrev() throwing 265926 error code (End Of RowsSet). Jochen Arndt7-Aug-18 22:52 Jochen Arndt 7-Aug-18 22:52
 Re: MovePrev() throwing -2147217837 error code Sampath5797-Aug-18 23:23 Sampath579 7-Aug-18 23:23
 Re: MovePrev() throwing 265926 error code (End Of RowsSet). Jochen Arndt8-Aug-18 0:26 Jochen Arndt 8-Aug-18 0:26
 Re: MovePrev() throwing 265926 error code (End Of RowsSet). Sampath5798-Aug-18 1:01 Sampath579 8-Aug-18 1:01
 Re: MovePrev() throwing 265926 error code (End Of RowsSet). Jochen Arndt8-Aug-18 1:29 Jochen Arndt 8-Aug-18 1:29
 Re: MovePrev() throwing 265926 error code (End Of RowsSet). Sampath5798-Aug-18 4:19 Sampath579 8-Aug-18 4:19
 Re: MovePrev() throwing 265926 error code (End Of RowsSet). Jochen Arndt8-Aug-18 4:21 Jochen Arndt 8-Aug-18 4:21
 Re: MovePrev() throwing -2147217837 error code. Sampath57912-Aug-18 2:36 Sampath579 12-Aug-18 2:36
 Re: MovePrev() throwing 265926 error code (End Of RowsSet). David Crow8-Aug-18 5:45 David Crow 8-Aug-18 5:45
 Re: MovePrev() throwing 265926 error code (End Of RowsSet). Sampath5798-Aug-18 6:16 Sampath579 8-Aug-18 6:16
 Re: MovePrev() throwing 265926 error code (End Of RowsSet). David Crow9-Aug-18 5:56 David Crow 9-Aug-18 5:56
 Re: MovePrev() throwing 265926 error code (End Of RowsSet). Stefan_Lang8-Aug-18 22:44 Stefan_Lang 8-Aug-18 22:44
 Last Visit: 16-Feb-19 12:17     Last Update: 16-Feb-19 12:17 Refresh « Prev1...32333435363738394041 Next »