Click here to Skip to main content
15,885,278 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionmfc dailog based application Pin
Member 1025201221-Oct-13 1:19
Member 1025201221-Oct-13 1:19 
AnswerRe: mfc dailog based application Pin
Richard MacCutchan21-Oct-13 1:38
mveRichard MacCutchan21-Oct-13 1:38 
AnswerRe: mfc dailog based application Pin
Garth J Lancaster21-Oct-13 1:38
professionalGarth J Lancaster21-Oct-13 1:38 
AnswerRe: mfc dailog based application Pin
David Crow21-Oct-13 3:07
David Crow21-Oct-13 3:07 
AnswerRe: mfc dailog based application Pin
Captain Price21-Oct-13 5:51
professionalCaptain Price21-Oct-13 5:51 
QuestionHow to control Scroll bar in CListCtrl using VC++ Pin
shanmugarajaa20-Oct-13 21:34
shanmugarajaa20-Oct-13 21:34 
AnswerRe: How to control Scroll bar in CListCtrl using VC++ Pin
Richard MacCutchan20-Oct-13 21:44
mveRichard MacCutchan20-Oct-13 21:44 
QuestionOrder Pin
messages20-Oct-13 4:08
messages20-Oct-13 4:08 
Writing a program to compute n series of Fibonachi (Recursive and No Recursive )
I wrote this for non recursive
C++
#include <iostream>
using namespace std;

int Fibo(int number);
int _tmain(int argc, _TCHAR* argv[])
{
	int i,sum,n,a1,a2;
cout<<"enter number : "<<endl;
cin>>n;
i=3;
 sum=0;
 if(n==1)
 cout<<"1";
 else if(n==2)
 cout<<"1,1";
 else
 {
cout<<"1 ,1 ,";
a1=1,a2=1;
while (i<=(n))
{
	 sum=a1+a2;
cout<<sum<<" , ";
  a1=a2;
  a2=sum;
  i++;
}
 }
	return 0;
}

And this for Recursive mode
 int _tmain(int argc, _TCHAR* argv[])
{
 int ii=1,nn=0;
 cout<<"enter number:"<<n;
 cin>>nn;
 while(ii<=nn)
 {
	 cout<<"\t"<<Fibo(ii);
	 ii++;
 }

int Fibo(int number)
{
if((number==0) || (number==1))
return number;
else
return Fibo(number-1) + Fibo(number-2);
}

buw my question how can I compare these two methods for memory usage and their speed?
QuestionRe: Order Pin
David Crow20-Oct-13 16:05
David Crow20-Oct-13 16:05 
AnswerRe: Order Pin
messages21-Oct-13 3:07
messages21-Oct-13 3:07 
AnswerRe: Order Pin
Ron Beyer20-Oct-13 17:15
professionalRon Beyer20-Oct-13 17:15 
GeneralRe: Order Pin
messages21-Oct-13 3:08
messages21-Oct-13 3:08 
GeneralRe: Order Pin
Ron Beyer21-Oct-13 4:57
professionalRon Beyer21-Oct-13 4:57 
AnswerRe: Order Pin
rashin ghodratzade27-Oct-13 22:24
rashin ghodratzade27-Oct-13 22:24 
QuestionHow to catch wave API WHDR_DONE flag? Pin
Vaclav_19-Oct-13 4:41
Vaclav_19-Oct-13 4:41 
QuestionRe: How to catch wave API WHDR_DONE flag? Pin
David Crow19-Oct-13 16:36
David Crow19-Oct-13 16:36 
AnswerRe: How to catch wave API WHDR_DONE flag? SOLVED with timer and while loop Pin
Vaclav_20-Oct-13 5:29
Vaclav_20-Oct-13 5:29 
GeneralRe: How to catch wave API WHDR_DONE flag? SOLVED with timer and while loop Pin
David Crow20-Oct-13 16:02
David Crow20-Oct-13 16:02 
Questionsystem call mknod() failing with errno 2 on ubuntu Pin
SunilKrSingh19-Oct-13 1:04
SunilKrSingh19-Oct-13 1:04 
AnswerRe: system call mknod() failing with errno 2 on ubuntu Pin
Richard MacCutchan19-Oct-13 2:34
mveRichard MacCutchan19-Oct-13 2:34 
NewsBeginning WPF 4.5 by Full Example (EPUB) Pin
Stephen. P .Thomas19-Oct-13 0:09
Stephen. P .Thomas19-Oct-13 0:09 
QuestionWait for event versus while / do loop or timer – academic questions Pin
Vaclav_18-Oct-13 12:55
Vaclav_18-Oct-13 12:55 
AnswerRe: Wait for event versus while / do loop or timer – academic questions Pin
Richard Andrew x6418-Oct-13 13:31
professionalRichard Andrew x6418-Oct-13 13:31 
AnswerRe: Wait for event versus while / do loop or timer – academic questions Pin
digitalspace.xjtu18-Oct-13 16:46
digitalspace.xjtu18-Oct-13 16:46 
AnswerRe: Wait for event versus while / do loop or timer – academic questions Pin
pasztorpisti19-Oct-13 4:30
pasztorpisti19-Oct-13 4:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.