|
set the _crtBreakAlloc value at first in your program. Maybe you have set the value too late.
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
I note that you're using MFC - try putting these lines in your stdafx.h before any #include s.
#if defined(DEBUG)
#define new DEBUG_NEW
#endif
That way, allocations are tracked slightly better - I get messages like this:
Detected memory leaks!
Dumping objects ->
d:\mycode\mydlg.cpp(228) : {442} normal block at 0x0034EF00, 4 bytes long.
Data: < > CD CD CD CD
Object dump complete.
You can double-click on the d:\mycode\mydlg.cpp(228) : {442} normal block at 0x0034EF00, 4 bytes long. line and it will take you to the source that did the leaking allocation.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
modified on Monday, April 20, 2009 7:07 AM
|
|
|
|
|
As we can overload operators in c++, the same can we do in c?
if there any way of doing it, please post.
i will appreciate any suggestion.
|
|
|
|
|
no. operator overloading is a feature from OOPS.
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
Actually what I want is to construct my own float.
float16... actually...
which should be of following config;
float16
Bits Purpose
1 Sign of mantissa
2 – 32 Mantissa
33 Sign of exponent
34-128 Exponent of 10
and it should work similar to float,
as we do
float a;
float b;
float c = a + b;
hence here for my program concern i will have to do overloading...
float16 a;
float16 b;
float16 c = a + b;
any idea if u have, it will be a great help to me...
thanks great minds....
|
|
|
|
|
In C++ this is possible but not in C. Remember that in C, you only have structures which can't have any member functions (only variables).
What you will need to do is define an external function which adds two float16:
float16 add(float16 val1, float16 val2)
And call this function when you want to add two float16:
float16 c = add(a, b);
|
|
|
|
|
Can you please tell me any data structure that could contain 1 bit of data only. means can store only 0 or 1. because in the corresponding problem, i require a data structure that can contain atmost 1 bit of data.
|
|
|
|
|
Aakash Johari wrote: Actually what I want is to construct my own float.
Aakash Johari wrote: any idea if u have,
it will be a great help to me...
Yes: use C++ .
BTW:
Aakash Johari wrote: 1 Sign of mantissa
2 – 32 Mantissa
33 Sign of exponent
34-128 Exponent of 10
Are you sure it is a good idea?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hello Aakash,
Operator overloading doesn't exists in C.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
I know that a share path (say \\MycolleaguesmachineIP\\Ourshare\Projects ) exists.
How do I determine that it does exist, programmatically.
I came across NetShareEnum API but am not sure of its parameter values.
Any help in this regard or any other alternative would be appreciated .
Thanks in Advance
|
|
|
|
|
|
Hello Sherteks,
you can use - PathFileExists()[^] to check whether the specified file/directory exists.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Hi All
How can i check files/folder is exits or not in paticular drive like c:\\?Plz help me
|
|
|
|
|
Hello Davitor,
Misunderstood the question.
You can use this api - PathIsDirectoryEmpty()[^].
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
modified on Monday, April 20, 2009 3:02 AM
|
|
|
|
|
|
You may use PathFileExists[^]
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
You can use of FindFirstFile .
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
#include <windows.h>
int main ()
{
MessageBox(NULL, "Please do not press okay, just wait.", "Beginning", MB_EXCLAMATION);
return 0;
}
I would like to make this message box close on its own in 5 seconds.
|
|
|
|
|
|
Why do you need such a message box? Are you needing to show some kind of a progress?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
|
Hellow!
Now, I have a problem when input chinese(宝) into _RecordsetPtr for filtering.
Building environment is following
- VC++ 6.0
- unicode debug
- Inputed Chinese charactor by user in IE 6.0 installed the ActiveX.
- So user will input the character 宝 in ActiveX, and filtering button click.
(example)
_RecordsetPtr pRS;
pRS.CreateInstance(__uuidof(Recordset)); //create
CreateEmptyResultRecordset(pRS); //recordset header
pRS->Open(vtMissing, vtMissing, adOpenStatic,adLockBatchOptimistic,-1);
~~
~~
pRs->Fields->GetItem((_bstr_t)tpfd->m_StringID)->PutValue((_bstr_t)tpData->GetAt(j));
"tpData" is CStringArry type, and tpData->GetAt(j) will return CString type.
When using "PutValue((_bstr_t)tpData->GetAt(j))", occured COM errors.
When My IME setting was changed Korean to Chinese, the problem is not happend.
How can I do? ~~~~
|
|
|
|
|
I'm trying to get my program to print out an asterisk when then user is typing in his/her password.
I've gotten this part to work, however. for debugging issues I'm also trying to make the program print the password at the end. It's currently only outputting the last letter typed in as if its the password.
So, how can I make the program output the entire actual password. Here is my code:
#include <conio.h>
#include <iostream.>
#include <windows.h>
using namespace std;
char password1;
char password2;
char password3;
int x=1;
int main()
{
do{
cout << "Enter a test password: " ;
do{
password1=getch();
if((password1>=65) && (password1<=122)){cout << "*";
password2=password1;
password3=password2+password1;}
else{cout << "";}
}while(password1!=13);
cout << "\nYour password is " << password3;
Sleep(2000);
system("cls");
}while(x=1);
return 0;
}
password2 and 3 were adding in when i was trying to get it to work.
|
|
|
|
|
Did you check your program?
1. >> password1=getch();
- you are getting the KB i/p on password1.
2. >> password2=password1;
- Assigning the same value to password2
3. >> password3=password2+password1;
- concatenating the the same values to password3. Also you are concatinating 'char'( 1 byte) ie. the ascii value are added and will not be an expected value.
Use password2 as a char array and use string functions to concatenate the password1 to password2.
aks
|
|
|
|
|
reply, wouldnt allow me to do that, however, I fixed that issue around 30 minutes ago. I now have:
#include <conio.h>
#include <iostream.>
#include <windows.h>
using namespace std;
char password1[25];
int x=1;
int i=0;
int main()
{
do{
cout << "Enter a test password: " ;
for(i=0;i<25;i++){
password1[i]=getch();
if(((password1[i]>=65)&&(password1[i]<=90)) || ((password1[i]>=97)&&(password1[i]<=122))
|| ((password1[i]>=48)&&(password1[i]<=57)) || ((password1[i]>=35)&&(password1[i]<=38))
|| ((password1[i]>=40)&&(password1[i]<=42)) || ((password1[i]==33))||((password1[i]==64))
|| ((password1[i]==94)) || ((password1[i]==32))){cout << "*";
i+1;}
if(password1[i]==13){goto end;}
else{cout << "";}
}
end:
for (i; i < strlen(password1); i++){
password1[i] = '\0';}
cout << "\nYour password is " << password1[0] << password1[1] << password1[2] << password1[3] << password1[4] << password1[5] << password1[6] << password1[7] << password1[8] << password1[9] << password1[10] << password1[11] << password1[12] << password1[13] << password1[14] << password1[15] << password1[16] << password1[17] << password1[18] << password1[19] << password1[20] << password1[21] << password1[22] << password1[23] << password1[24] << password1[25];
Sleep(2000);
if(password1[i]=='password'){goto end1;}
system("cls");
}while(x=1);
end1:
cout << "\nIT WORKS!";
getch();
return 0;
}
This works completely other than it doing the password check which im still looking into. feel free to help
|
|
|
|