|
>> I was confusing that how dose mapUsed know itself is a const one and return const_iterator...
It depends on how "mapUsed" is declared for the function func :
void func(const map<X,Y> mapUsed)
since "mapUsed" is declared as a const, the compiler naturally uses the const_iterator.
- Bio.
|
|
|
|
|
I thought it is about the program language
Now I know the complier do this, Thank you
|
|
|
|
|
Most welcome york528
|
|
|
|
|
This my program
int _tmain(int argc, _TCHAR* argv[])
{
int a=0;
double b=10;
double result = pow(b,a);
double r=0;
for(int aa=0;aa<30000;aa++)
{
for(int i=0; i<30000;i++)
{
for(int j=0; j<30000;j++)
{
r = pow(b,a);
if(r != result)
{
int error =0;
}
}
}
}
return 0;
}
I put a breakpoint on the int error = 0. It got hit when aa=0,i=19383,j= 26848.
Could this be a hardware problem or something else?
Running VS2008 with latest service packs.
|
|
|
|
|
Member 2088 wrote: I put a breakpoint on the int error = 0. It got hit when aa=0,i=19383,j= 26848.
What were the values of r and result at the time of failure?
|
|
|
|
|
When it hit the error line
r = -1.#IND000000000000
a and b are correct.
|
|
|
|
|
Member 2088 wrote: When it hit the error line
r = -1.#IND000000000000
a and b are correct.
So what were the values? Also I asked what the value of result was.
|
|
|
|
|
b=10.000000000000000
a = 0
result = 1.0000000000000000
|
|
|
|
|
Is this really the intent of the program, to never change "a" or "b"? because in this case, you'll always get a result of 1. So you'll be going in a double-nested loop for a long time to just get a result of 1...
|
|
|
|
|
The point is to demonstrate the 'random' failure.
|
|
|
|
|
The value -1.#IND indicates a number that cannot be represented (IND = indeterminate) and will be caused by a floating point error. This could well be a hardware problem but it is impossible to be certain.
|
|
|
|
|
Your program ran without a problem on my system. It never reached the break point.
|
|
|
|
|
Member 2088 wrote: double b=10;
double result = pow(b,a);
double r=0;
What happens if you did:
double b = 10.0;
double r = 0.0;
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Are you only running the block of code above or is it part of a larger program? Taking over a buggy program in the past, I have had programs that malfunction when a variable name was changed from x to y. This was the result of memory errors that I had to track down and fix.
|
|
|
|
|
Hi,
I have a excel file with two columns. Namely Binary Name, Binary Size. I need to read each binary name,size from the excel file and compare that with the Binary name and size in the corresponding installation folder.
Can I have a code snippet for reading the Binary Name, Binary Size from the .xlsx file
Thanks in advance.
|
|
|
|
|
Try this[^], lots of good suggestions for you.
|
|
|
|
|
Are you wanting to use Excel Automation, or if you are using MFC, there's CDatabase and CRecordset which can read through an Excel file via ODBC.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi All,
Please look into the errors which i am getting, if someone has faced same then please tell me where i am going wrong.
Errors are:
fatal error C1083: Cannot open type library file: 'xceedcry.dll': No such file or directory(in utils.h)
error C2146: syntax error : missing ';' before identifier 'IWebBrowser'
(in exdisp.h)
fatal error C1004: unexpected end of file found(in exdisp.h)
Thanks A Ton
Ash_VCPP
walking over water is just knowing where the stones are.....
|
|
|
|
|
Ash_VCPP wrote: fatal error C1083: Cannot open type library file: 'xceedcry.dll': No such file or directory(in utils.h)
That seems fairly clear, the file 'xceedcry.dll cannot be found. Does it exist in your system and if so is it in the include path(s) for your compiler?
I suspect the other two messages are related to the first.
|
|
|
|
|
Hello
I am developing virtual printer driver.The virtual printer have EMF spool file format.
I use windows default printer driver and forward print job at real printer.
I want to change in header and footer of .SPL(emf spool) file.Means i want put some default name in header and footer.
Is it possible to change via emf spool ?
or
Any other solution?
Thanks
Mahendra
|
|
|
|
|
hi every body.....
i have a small problem about the tiff virtual printer.
is it possible to access the virtual printers in vc++6.0.
i am searching on net finding only the possible vb6.0 and .net.
so please help me.
it's very useful to my application.
thanks in advance............
|
|
|
|
|
I suppose they you can handle them the same way you do with real devices.
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
Everybody ,as always i give thansk to all of you to resolve my last problems.This time my stuck with following problem.
I have to built a mfc aplication in Visual 6 c++ in which i have a combobox,to whom i have to load elements from a .ini o txt files ,like if user want to add more elements in the combobox by just adding elements from ini o txt the corresponding files.
i was thinking to user getprivateprofilestring() but it is very limited ,then i have to use many of these funcions in my application .
Please tell me how should i built this application
Thanks in advance
|
|
|
|
|
write a class to wrap some of the function. And by doing this rethink the design of your code.
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
But i should be need something flexible , i am thinking about the template of Array ,something like
that ,but i dont have any idea to use template and how to load them .
Do u have any idea
|
|
|
|