15,902,492 members
Home / Discussions / C / C++ / MFC

# C / C++ / MFC

 Re: error C2440 MsmVc5-Apr-10 22:13 MsmVc 5-Apr-10 22:13
 Re: error C2440 Fareed Rizkalla4-Apr-10 23:12 Fareed Rizkalla 4-Apr-10 23:12
 Re: error C2440 MsmVc4-Apr-10 23:28 MsmVc 4-Apr-10 23:28
 Re: error C2440 Fareed Rizkalla5-Apr-10 4:14 Fareed Rizkalla 5-Apr-10 4:14
 Re: error C2440 MsmVc5-Apr-10 19:13 MsmVc 5-Apr-10 19:13
 How can generate Max. Combination of given Value? Le@rner4-Apr-10 19:58 Le@rner 4-Apr-10 19:58
 Re: How can generate Max. Combination of given Value? Adam Roderick J4-Apr-10 20:02 Adam Roderick J 4-Apr-10 20:02
 Re: How can generate Max. Combination of given Value? Le@rner4-Apr-10 20:19 Le@rner 4-Apr-10 20:19
 ```int fac(int n) { if (n == 0) return 1; else return n*fac(n - 1); } void permute(char *string, int n, int rank) { vector vec; for (int ctr = 0; ctr < n; ctr++) vec.push_back(string[ctr]); for (int ctr = n; ctr >= 1; ctr--) { int quotient = rank/fac(ctr-1); char c = vec[quotient]; vec.erase(vec.begin()+quotient); *string++ = c; rank%=fac(ctr-1); } } void showpermutes(char *string) { char temp[20]; int n = strlen(string); // if the string is too big, we can't continue if (n > 19) return; int nfac = fac(n); for (int ctr = 0; ctr < nfac; ctr++) { strcpy(temp, string); permute(temp, n, ctr); cout << temp << endl; } } int _tmain(int argc, _TCHAR* argv[]) { showpermutes("AB"); system("PAUSE"); getche(); return 0; }```
 Re: How can generate Max. Combination of given Value? Adam Roderick J4-Apr-10 21:01 Adam Roderick J 4-Apr-10 21:01
 Re: How can generate Max. Combination of given Value? Le@rner4-Apr-10 21:24 Le@rner 4-Apr-10 21:24
 Re: How can generate Max. Combination of given Value? Adam Roderick J4-Apr-10 21:35 Adam Roderick J 4-Apr-10 21:35
 Re: How can generate Max. Combination of given Value? Le@rner4-Apr-10 21:39 Le@rner 4-Apr-10 21:39
 Re: How can generate Max. Combination of given Value? CPallini5-Apr-10 0:11 CPallini 5-Apr-10 0:11
 combinations repetition allowed MsmVc4-Apr-10 19:33 MsmVc 4-Apr-10 19:33
 Re: combinations repetition allowed CPallini5-Apr-10 0:13 CPallini 5-Apr-10 0:13
 CString multiple assignment leak? TechAvtar4-Apr-10 19:12 TechAvtar 4-Apr-10 19:12
 Re: CString multiple assignment leak? [modified] LunaticFringe4-Apr-10 19:30 LunaticFringe 4-Apr-10 19:30
 Re: CString multiple assignment leak? Adam Roderick J4-Apr-10 20:15 Adam Roderick J 4-Apr-10 20:15
 Re: CString multiple assignment leak? TechAvtar4-Apr-10 21:35 TechAvtar 4-Apr-10 21:35
 Re: CString multiple assignment leak? Adam Roderick J4-Apr-10 21:40 Adam Roderick J 4-Apr-10 21:40
 Re: CString multiple assignment leak? Joe Woodbury5-Apr-10 6:41 Joe Woodbury 5-Apr-10 6:41
 Second Window in Win32 Fareed Rizkalla4-Apr-10 14:51 Fareed Rizkalla 4-Apr-10 14:51
 Re: Second Window in Win32 enhzflep4-Apr-10 15:09 enhzflep 4-Apr-10 15:09
 Re: Second Window in Win32 Fareed Rizkalla4-Apr-10 20:53 Fareed Rizkalla 4-Apr-10 20:53
 Re: Second Window in Win32 enhzflep5-Apr-10 1:59 enhzflep 5-Apr-10 1:59
 Last Visit: 31-Dec-99 18:00     Last Update: 21-May-24 3:37 Refresh ᐊ Prev1...1985198619871988198919901991199219931994 Next ᐅ