|
I won't do your homework... but I will offer some hints. The repeated groups have an easily followed formula, so easily put in algorithmic form as a check of when to display when to skip. However, depending on your teacher you can also set a boolean array of finished items and check against that. It depends on if the teacher wants his exact solution, or any workable solution. Most want their solution, which means you might want to start on a little smaller case than the assignment one, but larger than the first example and find what is the same with each that are "already done".
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
includeh10 wrote: ...display 2 of them every time for all possible cases but no repeating (is it called Arrangement in math?)
It's either a permutation or a combination. Either one can be made to repeat or not. The distinction is whether the resulting set is ordered.
includeh10 wrote: a0,a1,...,a100 (or an int array ia[100]),
a0 through a100 is 101 elements.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Hello Friends
Can any tell one any websites where I can learn MFC programming from begineer point of view?
I will be grateful to any one who can help me in this matter
|
|
|
|
|
please refer to
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/HTML/_core_mfc.3a_.overview.asp
|
|
|
|
|
phijophlip wrote: Can any tell one any websites where I can learn MFC programming from begineer point of view?
I would recommend to you Yashwant Kanetkar's book on MFC programming. It's one of the best that I found. This book starts from ground up. It explains to you very basic things in great detail.
Nibu thomas
Software Developer
|
|
|
|
|
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmfc98/html/mfchm.asp
Helping others satisfies you...
|
|
|
|
|
|
Well done Cedric Moonen the codeproject is good
|
|
|
|
|
Yah CodeProject is very good source. I believe i have learned most of MFC (though i am not too good in MFC) through CodeProject.
Thank You CodeProject
We Believe in Excellence
|
|
|
|
|
Hi,
I have a fundamental doubt on Windows messaging structure..
how GetMessage & Peek message differs ?
Thanks & Regards,
Siva
|
|
|
|
|
PeekMessage returns immediately, even if there is no messages in the queue. GetMessage will wait until a message is in the queue.
|
|
|
|
|
Actually, am having an array of Int values, i would like to convert into char array, as i need to save this data in a text file.
am using itoa(), but i couldne get the result.
Can anybody could help me out?
|
|
|
|
|
I suppose you want to convert int values into strings (and not into a char value). What is the problem with itoa ?
You could also use sprintf.
|
|
|
|
|
actually, i would like to load the int array data which is obtained from a machine to a txt file, i could open the text file, but i couldnt write the data i,e int array to text file, its writing some junk values.
int array[100];//am having an int array
char txt[100];//would like to convert the numbers in int array to string and should be stored in txt array.
for(i=0;i<=100;i++)
{itoa(array[i],txt,10);
fwrite(txt,1,strlen(txt),f);//f=fopen("data.txt", "w+");
}
|
|
|
|
|
Hi chaitanya22,
For save data in the file please studing CArchive
|
|
|
|
|
You cannot convert the entire array at once using itoa . You have to pick out individual elements for conversion.
For eg:
#include "stdafx.h"
#include "sstream"
int main()
{
string strIntArray;
stringstream sstr;
int randomArray[10];
for(int index=0;index<10;index++)
{
randomArray[index] = rand()%10000;
}
for(int index=0;index<10;index++)
{
sstr<<randomArray[index]<<", ";
}
cout<<sstr.str();
}
Nibu thomas
Software Developer
|
|
|
|
|
hi,
did u include stdlib.h where itoa() is described?
Chetan.
Helping others satisfies you...
|
|
|
|
|
|
Hi Chaitanya,
Try out this.
FILE *fp;
fp = fopen("chat.txt","w");
int a[10] = {5,15,25,35,45,55,65,75,85,95};
char p[20];
for (int i = 0;i < 10; i++)
{
itoa(a[i],p,10);
fprintf(fp,"%s ",p);
}
Chetan.
Helping others satisfies you...
|
|
|
|
|
chaitanya22 wrote: Actually, am having an array of Int values, i would like to convert into char array, as i need to save this data in a text file.
There is no need to convert just to save to a text file. Numbers can be written to the file just like characters can.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
hi guys,
How can I find whether my system is connected to Internet. If possible give me code snippet.
Thanks n regards
viveks
"Winners Dont to different things they do things differently"
|
|
|
|
|
See here[^]
Thanks to DavidCrow
Nibu thomas
Software Developer
|
|
|
|
|
How can i do something before Windows is shutting down?
I can do something before an App is closing in "OnClose" (MFC), but how can i do something before Windows is shutting down?
Does anyone has a good idea?
A method in an MFC way will be good. But other methodes are also desired
Thx in advance
Mike
|
|
|
|
|
OnQueryEndSession[^]
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
Thx a lot
|
|
|
|