|
Well said, but I still hate the univoters (who do it without reasoning). I wish they could get a life, which they apparently don't seem to have.
|
|
|
|
|
nobody here is going to do your homework for you
|
|
|
|
|
So you ask a public forum to do your assignment, right ?
how much are you willing to pay for us to do something you're supposed to be able to do yourself ?
|
|
|
|
|
Aasia Naz wrote: The objective of project is to enhance your knowledge and sharpen your analytical and programming abilities so that you can work in a professional environment.
You know, asking people to do your homework certainly does not meet the objective of this project.
This is CS201 - a second level course I presume. Is it really that baffling to you ? If so I would seriously consider another area of study.
|
|
|
|
|
Oh my god You didn't even try to mask it. You simply copy/pasted the question that was asked to you without even bothering to adapt it to your public...
It's a real pity that you forgot to put the adress of the guy for which you had to do the work
|
|
|
|
|
Aasia Naz wrote: It should be clear that your project will not get any credit if:
o The project is submitted after due date.
o The submitted project does not open or file corrupt.
o The project is copied.
seems that i wont do this because i care about your grades.
|
|
|
|
|
Your request is in processing.
|
|
|
|
|
I have a really simple question which I cannot seem to find the answer to...
If I allocate memory like this:
char * pArray = (char*)malloc(123);
Then I free it with:
free(pArray);
And the same with:
char * pArray = new char[123];
And
delete[] pArray;
But how would I free an array created like:
WCHAR pwszRealPath[MAX_PATH];
The best answer I can find is that I don't but I would like to know why.
|
|
|
|
|
__DanC__ wrote: how would I free an array created like:
WCHAR pwszRealPath[MAX_PATH];
such an array is created on the stack, and not on the heap.
so basically, no need to free it
it will be destroyed when going out of scope, of at program termination if static/global...
|
|
|
|
|
Thanks, that is what I thought would be the case but wanted to clarify in case I go causing any memory leaks!
|
|
|
|
|
to be very clear here is what happens with this code:
char* pArray = new char[123];
a variable pArray of type pointer to char is created on the stack.
then, a block of 123 chars is allocated on the heap.
the address of the just allocated memory is stored into the pointer variable you have on the stack (pArray).
so, if you put such a code into a scope, and if you don't free the memory allocated before going out of scope, the variable on the stack is destroyed, but not the memory block on the heap.
so you just loose the reference (the address) to your allocated memory on the heap, hence the memory leak...
|
|
|
|
|
To make things even more simple, there's only one little rule to remember:
everything that is allocated with new should be deleted using delete; everything that is allocated with new...[] should be deleted using delete[] and everything that is allocated with malloc should be deleted with free.
For the rest, you don't have to care (and Toxcct explained that a bit more in details).
|
|
|
|
|
But what about GlobalAlloc()?
(Sorry, couldn't resist. )
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
|
I was making a joke.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Hi, I'm looking for a way to do a completely owner-drawn Listbox in C++ with just the Windows API and without MFC. The LBS_OWNERDRAWFIXED allows me to draw the items in the list, but is there a way for me to owner-draw the entire listbox (along with the scroll bars, etc)? Or do I have to subclass the listbox and draw it when it receives WM_PAINT?
Thanks!
KR
|
|
|
|
|
Well owner draw does what it does. You can't make it do something it doesn't do. Does that answer your question?
led mike
|
|
|
|
|
I was hoping there was a listbox ownerdraw style that would have the same behavior as BS_OWNERDRAW does for buttons. I guess you're saying there isn't one?
KR
|
|
|
|
|
KellyR wrote: I guess you're saying there isn't one?
Yes. As far as I know there is only one owner draw mechanism for each control that supports owner draw.
led mike
|
|
|
|
|
|
|
Hi.
I have created a simple database table using class / structure in C++. For ex.
<pre>
class StudentTable{
int m_nRollNo;
CString m_strFirstName;
unsigned int m_uAge;
unsigned short m_uPercentageOfMarks;
};
</pre>
The records are stored in stl vector.
Now I want the execute query like expressions on the data for ex.
"m_uPercentageOfMarks >= 80 and m_strFirstName like 'A%'" - First name starting with A for matching is ok
How do I execute these query expressions with the stored data? Parsing the expression is ok but how to relate these fields + operator (and/or/not) and actually execute these expressions in one go..
Please suggest how this can be achieved.
Thanks in advance.
Thanks & Regards,
Nilesh Prakash Bhatkhalkar
|
|
|
|
|
NileshBhatkhalkar wrote: Please suggest how this can be achieved.
As far as I know nothing standard exists as one library that will do that for you, you would have to develop it yourself. That's why most people use databases or something else that meets their requirements.
led mike
|
|
|
|
|
Hi to all,
How to do Globalization/Localization in VC++?
Regards,
Aniket A. Salunkhe
modified on Tuesday, July 29, 2008 11:44 AM
|
|
|
|
|
what do you mean by "Globalization" ?
have variables global ?
make "global" libraries ?
|
|
|
|