|
Thanks i understand you are guiding me,but it this correct what i'm doing now.Please have a look and if there is mistakes please correct me.
Thank you.
#include<iostream.h>
#include<ctime>
#include<math.h>
CFile f;
if (!f.Open ("FileName.ext", CFile::modeRead))
{
//Read your ints
}
if (!f.Open ("FileName.ext", CFile::modeWrite))
{
//Write your ints
}
void CMyView::WriteFile (CFile* file)
{
int Array[LIM];
for (int i = 0; i < lim; i++)
{
//fill with random
}
int* pBuf;
pBuf = &Array[0];
file->Write (pBuf, sizeof (Array));
}
void insertionsort(T data[],int n)
{
for(int i=1,j;i
T tmp=data[i];
for(j=i;j>0&&tmp
data[j]=data[j-1];
data[j]=tmp;
}
}
void main()
{
int x, y, z;
int arr[];
getArray (arr, n);
cout<<"The array before sorting was"<<endl;
="" for="" (x="0;" x<n;="" x++)
=""
="" {
="" cout<<arr[x]<<'="" ';
="" }
="" cout<<endl;
="" insertionsort="" (arr,="" n);
="" cout<<"the="" array="" after="" sorting="" was="" (assending)"<<endl;
="" (y="0;" y<n;="" y++)
="" cout<<arr[y]<<'="" (decending)"<<endl;
="" (z="n;" z="">=0; z--)
{
cout<
|
|
|
|
|
Just some advices...
1) Use "< pre > your code < /pre >" for snippets of code biggers than some lines, and "< code > your sentence < /code >" to highlite sentences in red (as I made). The first tags make:
it would be easier for us to read
2) The best way to do it is... you make your program, you compile in your computer. Try to solve your errors (can be missings ; or easy things) and... if you don't know what is happening... THEN write us the error that your compiler says, and the piece of code where the compiler sends you when you double click on the error.
If we need more information... we will ask you to give us more code or to answer concrete questions we make
About your code...
I have write a guide, not a functional code... // This 2 shlashes means that, up to this point all the things in the line are COMMENTED, so is not going to be read/compiled.
So... you have to try there, a piece of valid code. I mean (and I do one thing) with this:
for (int i = 0; i < lim; i++)
{
}
has to be done something, for example...
srand( (unsigned)time( NULL ) );
for (int i = 0; i < lim; i++)
{
myArray[i] = rand ();
}
With that you fill an array with LIM - 1 positions with random numbers.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Nelek wrote: The easiest way is to use an empty project with Doc/View arquitecture.
Gotta love driving nails with a sledgehammer!
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
snoop82 wrote: How to create several files of integers to be used to test sorting.several sizes, for example, size 20, 200, and 2000. Make files that are in order, in reverse order...
Do you have access to Excel?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Well if you have a pseudo random generator and it's always initialized with the same seed than you will always generate the same sequence of numbers!!!
Thus it's possible to do the performance comparison test you are taking about.
---
Yours Truly, The One and Only!
devmentor.org
Design, Code, Test, Debug
|
|
|
|
|
Hi i am working on a dialog box in a MFC application in VC 6.0 I want to use a simple button on which there is no text written instead a bmp image is drawn. what i actually need is that the image of button will change on mouse over,mouse down,mouseup etc. I need help of you people to solve this problem.
Thanks
|
|
|
|
|
You must draw the different images yourself in the OnPaint() function and check your conditions. Search for ownerdrwan buttons (XPButton)
This is the way not the solution...
Greetings from Germany
|
|
|
|
|
Try to find 'BtnST' class on this site. All you have to do is place a button on dialog, delete all text and in your .h file(wich you added to yours project) declare them as 'CButtonST' (a.g. CButtonST m_btnMY). It take this much code in yours cpp:
m_btnMY.SetIcon(IDI_ICON10);
m_btnMY.SetFlat(TRUE);
m_btnMY.SetTooltipText(_T("some text"));
and that is it!!!
You could do a whole lot more... just reed the article and take at look at sample!
|
|
|
|
|
Fine idea, but I was not the asker.
Greetings from Germany
|
|
|
|
|
I'm sorry, I didn't mean to send this to you. When I clicked replay I meant generally to original post. Once again sorry!
|
|
|
|
|
Thaks a lot dear fellow
your suggestion really helped me a lot.
looking forward for further collaboration.
Regards
|
|
|
|
|
Happy I could help!
Be aware of an a little bug I discovered, tooltips working fine before you press the button, but after that (when whatever code you run under the button press ends) tooltips do not appear any more so you have to put them back:
void CMyDlg::OnBtnMY() <br />
{<br />
m_btnMY.SetTooltipText(_T("some text"));<br />
}<br />
|
|
|
|
|
|
can you please tell me which visual studio you are working in ?
Also check the font of your editor, may be it got changed.
Do a test -
Copy some text from vc editor which contains " and ?.
Paste it in notepad. Now check if notepad shows the original characters.
Also do the reverse of it, Copy text from notepad and paste in vc editor.
Are the characters got changed now also ?
|
|
|
|
|
|
Good to hear that
|
|
|
|
|
|
hey !
this is a forum, not a chat.
you don't have to repost the same question[^] again. just wait !
delete this and wait until someone knows your answer.
and don't forget GOOGLE and MSDN are your friends
|
|
|
|
|
You were faster :P
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Nelek wrote: You were faster
that'w what makes me a CodeProject Fixture
|
|
|
|
|
I heared that google is a friend but does MSDN new friend?;P
|
|
|
|
|
You already have a message below with the same question. If you have answered which format are you using, you don't have to ask againg including the format. Just wait for an answer in your first message.
Read the good answer of toxcct or mine to the message of snoop82
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
1) you spam the boards, so, this question have been marqued as SPAM.
2) you abuse the forum, so, your first question have been marqued so too.
3) use a correct english. people here are not all native english and it's already dificult enough to express themselves in a language that's not their mother tongue, so don't force them to guess which words you're typing.
4) no one here answer for money. we all belong to this forum for the pleasure, so we're not obliged to answer.
5) ask a specific question. don't expect us to do your homework.
6) use the html tags provided to format the messages correctly. a code sample should be placed in <pre></pre> blocks. use <code></code> to highlight som words if you like.
7) don't post a huge piece of code like you did. no one will read it, and worst, you give us a bad side of yours.
8) when you have an error, provide the relevant error message.
9) and never forget to tell what you already tried to go around the problem you got...
SO, please, delete these 2 questions immediately, and re ask like you would expect someone to ask a question if you had to answer it
-- modified at 5:44 Thursday 20th September, 2007
>>Thank you.
|
|
|
|
|
|
Programm3r wrote: 10) And never forget to thank the person you helped you
seems like he did[^]...
|
|
|
|