|
Hello I am new to c++. Can you help me in this program.
The program is- Use binary search technique to search a user given name from an array of 10 pre-defined names. Use of array is a must. The names in the array are already sorted alphabetically.
Thanking you in advance........................................bishshoy007
|
|
|
|
|
Please don't shout.
It looks like a (simple) homework assignment (we won't do it for you, but we may help). What have you done so far? What is your trouble about?
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]
|
|
|
|
|
|
You did not get the response you were hoping for here so you asked the very same, unedited question on a different forum. Amazing.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hi all
I am getting an error message in my application "This application has failed to start because cximagecrtd.dll was not found".
I tried to download the cximagecrt.dll/cximagecrtd.dll from net. But i couldn't able to find anywhere. Can some one please provide this for me.
Thanks in advance.
Regards,
balaram
|
|
|
|
|
You get the source and the project file when you download CxImage.
Just build the CxImageCrtDll project that's inside the CxImageLib workspace.
|
|
|
|
|
May I ask a question why you need to use of CXImage?
|
|
|
|
|
My question is when did this become a CXImage support site?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Did you see some posts of people they want to use of CXImage for load and show jpg,gif files while they have other ways.
|
|
|
|
|
Hi
I am facing problem in accessing the function template written inside a class. My code is as follows.
Please help me in this regard.
mytemp.h
class mytemp
{
public:
mytemp(void);
~mytemp(void);
template<typename t="">
static T templateadd(T x, T y);
};
mytemp.cpp
template <typename t="">
T mytemp::templateadd(T x, T y) {
return (x + y);
}
main.cpp
int _tmain(int argc, _TCHAR* argv[])
{
cout<<mytemp::templateadd(10,2); // Here I am getting error: unresolved external symbol ...
//Here I want to access templatedadd() of mytemp class. Please tell me What should be the statement.
return 0;
}
|
|
|
|
|
This is a subtle problem with templates, there's an explanation ahy it happens in here[^]
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Really helpfull.
Thanks a lot Sashoalm.
|
|
|
|
|
No problem
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
I have an application created with VS2005, consisting of some com-components created with VS2005. But one of the components is created by another department, so this component is still created with VS6. To find an error i have to debug from my application (VS2005) into this semi-external component(VS6). I have the symbols (.pdb) and the source files for the component and i succeed in stepping into the code of the component. But i can't watch any symbol. Has the PDB-format changed between this studio versions, are there any tricks to do the thing ?
|
|
|
|
|
Hi,
I want to change radio button while my program is running.
It start with normal radio button, but a want to change it while running so the text would be on the left side and the button on the right.
(It would look like radio button with "Left Text = true" when u click the button properties.)
I tried
CButton* button = GetDlgItem(IDC_RADIO1)
button->SetButtonStyle(BS_LEFTTEXT)
button->SetButtonStyle(BS_AUTORADIOBUTTON | BS_LEFTTEXT)
and few more but i failed.
Any idea ?
|
|
|
|
|
That isnt a good idea because it confuses a lot of users. Better rethink the design.
(if you really want to confuse the user, use 2 Buttons with one invisible and change the visibility)
Greetings from Germany
|
|
|
|
|
ido000 wrote: Any idea ?
Yes,
HWND hWndRadio = ::GetDlgItem(this->m_hWnd, IDC_RADIO1);
LONG lStyle = GetWindowLong(hWndRadio, GWL_STYLE);
lStyle |= BS_LEFTTEXT;
SetWindowLong(hWndRadio, GWL_STYLE, lStyle);
::InvalidateRect(hWndRadio, NULL, TRUE);
::UpdateWindow(hWndRadio);
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]
|
|
|
|
|
I want to use of your code freely?
|
|
|
|
|
char str[8];
cin >> str;
When run, if inputed string size more than eight byte, result run time error.
So, how to limit cin >> size or only get eight byte when inputed more than eight?
thanks!
|
|
|
|
|
allocate memory dynamically based on the size of the string
You can use a loop (upto 8) along with getch()/getchar() to get the user input
Some things seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
cin statement doesn't provide you with limited input support. since it wait for RETRUN/ENTER key for updating the input character in buffer supplied to it.!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/xml>
|
|
|
|
|
std::cin.get(str, sizeof(str), '\n');
or
std::cin >> std::setw(sizeof(str)) >>str;
|
|
|
|
|
hanlei0000000009 wrote: When run, if inputed string size more than eight byte, result run time error.
Were you expecting a different result? Why not use a string object instead?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hi Experts,
How can I import .rtf or .doc file content into TextBox.
|
|
|
|
|
Could anybody give reply?
|
|
|
|