|
Assuming you mean 1 * 2 * 3 * ... * 998 *999 * 1000, then I have bad news for you. The result when written out has 2568 digits in all. That is far more than even a 64 bit integer can express. So, either you have misunderstood your assignment, or you are supposed to be working with some arbitrary precision library. In either case, we don't do homework for you. If you have tried something and are stuck, we're happy to help point you in the right direction.
|
|
|
|
|
You may have a look at boost multiprecision library . This page gmp_int - 1.58.0[^] looks promising (see the code sample).
|
|
|
|
|
It's in the top cupboard by the door.
|
|
|
|
|
Developers don't find programs; they create them. Get started!
"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
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
hello every one please am working on a project where by on one of the class am ask to creat class board with enum so i have struggle but am not able to display. the question is " in class booard Define a C++ enumeration (enum struct) with values for no meals, breakfast, half pension and all inclusive as well as a related overloaded binary output operator."
expected output "
a all inclusive
b breakfast
h half board
w without meals
your choice:h "
please i need some one help
|
|
|
|
|
What about The Documentation?
And other resources?
.
|
|
|
|
|
I have created a CCombobox drop down and added three data through wizards and disable editing. I wanted to display some data/word initially in the edit ctrl part of the CCombobox before selecting the data present in the drop down.I having difficulty achieving this, could I have some pointers regarding this.
Thanks in advance.
|
|
|
|
|
To display some existing (in the combo listbox) item use CComboBox::SetCurSel.
To display some arbitrary text you could use SetWindowText method.
|
|
|
|
|
Thanks for replying.
Yes, I've tried using SetWindowText method. It's not showing in the combo box.
What I wanted was when I start my application it shows something like "please select something" before I select anything.
For edit ctrl box... We assigned something to the CSting variable and do UpdataData(FALSE).. I wanted to do something similar like this.
Thanks again.
|
|
|
|
|
Member 14575556 wrote:
What I wanted was when I start my application it shows something like "please select something" before I select anything. Are you doing something like:
m_list.AddString(_T("Item 1"));
m_list.AddString(_T("Item 2"));
m_list.AddString(_T("Item 3"));
m_list.AddString(_T("Item 4"));
m_list.InsertItem(0, _T("please select something"));
...
m_list.SetCurSel(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
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Member 14575556 wrote: Yes, I've tried using SetWindowText method. It's not showing in the combo box.
It does work for me.
Perhaps, you used DropdownList combo?
|
|
|
|
|
Victor Nijegorodov wrote:
Perhaps, you used DropdownList combo? Is that an MFC control?
"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
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Yes. I meant the MFC combobox with CBS_DROPDOWNLIST style.
|
|
|
|
|
Yes, I used MFC combobox with CBS_DROPDOWNLIST style.
|
|
|
|
|
Member 14575556 wrote: Yes, I used MFC combobox with CBS_DROPDOWNLIST style.
Then you will only able to display a string already inserted in the combo listbox. Use either CComboBox::SelectString or CComboBox::SetCurSel.
|
|
|
|
|
|
Thank you. This really match with what I wanted to do.
|
|
|
|
|
You are welcome. It always pays to check the documentation first.
|
|
|
|
|
I come back for another strange error (for me is strange ):
error C2143: syntax error : missing ')' before '{'
And the lin with error is:
TestAndClearDirty(ni);
and TestAndClearDirty is declared as:
#define TestAndClearDirty(ni) \
test_and_clear(ni, Name)
where test_and_clear(ni, Name) is defined as:
#define test_and_clear(ni, flag) \
test_and_clear_bit(NI_##flag, (ni)->state)
and clear_bit is declared as:
#define test_and_clear_bit(bit, var) \
({ \
const BOOL old_state = test_bit(bit, var); \
clear_bit(bit, var); \
old_state; \
})
How to get rid of this error ?
modified 10-Oct-19 12:11pm.
|
|
|
|
|
Once again there is information missing. I have tried putting those definitions in the correct order and compiling but it produces too many errors and unknown names.
|
|
|
|
|
You might try to get rid of those ugly macros (you are using C++, right?).
|
|
|
|
|
In fact is a C code which I try to convert to C++. I will try to call directly these functions ... I guess that you said, I am right ?
|
|
|
|
|
Yes, but I don't know if I can, because from step TestAndClearDirty(ni); to test_and_clear(ni, Name) , the second paramter is missing (see the first post).
Moreover, at step test_and_clear_bit(NI_##flag, (ni)->state) what is the first parameter ?
modified 11-Oct-19 6:44am.
|
|
|
|
|
That is exactly the problem. We do not have that information and you are not providing it.
|
|
|
|
|
Believe me, I haven't extra information, for instance, at step test_and_clear(ni, Name) , when I try to go to definition of Name , VS editor goes nowhere, searched globally in the whole project, found nothing, and searched in the entire project folder with the external file seeker, found no defintion of this Name parameter ...
|
|
|
|