|
First, I must apologize to you for my rudeness...
irs97 wrote: I was under the assumption that STL was suppose to make things easier.
This is true but you must know a bit of templates.
irs97 wrote: I thought lists, maps, ques, deques, vectors, linked lists, trees, were already created for you to use.
This is also true, but again, you must know a bit of templates.
Have a look to examples. STL documentation is quite too formal, while examples help you in practice.
Hope that helps.
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.
|
|
|
|
|
I don't have any book reccos but you could check out the STL section[^] here on CP.
|
|
|
|
|
*grin* That's just what I said.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi friends. I'm a new programmer. In an application, when i click About menu, i want the my About.h dialof form to display. In the MSND library, i saw such an example to display user defined dialogs;
{
Form ^ f = gcnew Form();
f->ShowDialog();
}
And i changed this code to display my About.h form dialog such as;
{
Form ^ About = gcnew Form();
About->ShowDialog();
}
But, i still see the same empty dialog instead of my About.h form. So how can i display this dialog when i click About menu ?
|
|
|
|
|
|
hope this helps, there, you're not creating an "about form", you're creating an empty form that is named "About". if you want to create an about form you'll probably need something like this:
<prv>
CAboutForm^ About=gcnew CAboutForm();
About->ShowDialog();
hope this helps
|
|
|
|
|
I want to extract the domain name from a url string. I know there is a function in wininet.dll InternetCrackUrl but I really don't want to link against the whole library to use just a single function. I tried passing the url into splitpath but it can't handle it ( the domain name is return as part of the path ).
Does anybody know of any other functions which may do the job?
|
|
|
|
|
Do you want the functionality of flags ICU_ESCAPE or ICU_DECODE?
Jeff
|
|
|
|
|
not really, I just want to extract the "www.google.com" from "http://www.google.com/search?url+split". For now at least, maybe later I will want to add more functionality.
|
|
|
|
|
It doesn't matter, I threw together a small function to do the job. It'll do for now at least.
bool SplitUrl( LPCSTR szUrl, LPSTR szLoc, UINT uLocSize )
{
UINT uCount = 0;
while ( *szUrl != '/' ){
if ( !*(szUrl) )
return false;
szUrl++;
}
if ( *(++szUrl) != '/' )
return false;
szUrl++;
while ( *szUrl != '/' && uCount < uLocSize-1 ){
if ( !*(szUrl) )
return false;
szLoc[uCount] = *szUrl;
szUrl++;
uCount++;
}
szLoc[uCount] = 0;
return uCount > 0;
}
|
|
|
|
|
You can always use dynamic loading thru LoadLibrary + GetProcAddress to resolve the function at runtime when you need to use it (perhaps to isolate all in a small class to cache this would be even better).
|
|
|
|
|
What is the difference between a function definition is in outside of a class in .cpp file and defined inside of a class in .h file when the header file is included by some other .cpp implementation file?
Thanks & Regards,
Suman
|
|
|
|
|
When you define a method inside the class (i.e. making declaration and definition at the same time), you're suggesting the compiler to inline expand inline that method. However, AFAIK, that's only a hint: the compiler may ignore your suggestion.
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.
|
|
|
|
|
By defining function inside class body, you are hinting compiler to make it inline. You may have look at this[^].
You can make function inline defining outside class body, by using keyword inline.
|
|
|
|
|
Thank you very much for the great help from you both!!
Thanks & Regards,
Suman
|
|
|
|
|
Hi All,
I can't seem to find a reference for the bit count instruction on a Pentium. I found the Bit Scan instructions, but not the Bit Count instruction. Is this not available on a Pentium (it's been about 4 years for me - I may be confusing RISC and CISC?)?
For example, EAX = 0x0000000A ( 1010 binary )
Bit Count = 2
Intel Pentium Instruction Set Reference Manual[^]
Jeff
|
|
|
|
|
In fact, I think there isn't.
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.
|
|
|
|
|
Thanks. It stinks getting old. You forget what you forgot...
Jeff
|
|
|
|
|
Dito!
But on the plus side we now know that all those old guys that said "I have forgot more than you know" were telling the truth.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
|
Thanks WalderMort. I had to do it the hard way. DirtyPad[^]
Jeff
|
|
|
|
|
For a byte, you may use a look-up table.
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.
|
|
|
|
|
|
I have tried... but some error appeared... in string funtion(strcpy/strcmp/strcat)...
Let me know a way... If could be... let me a full code... I think, it's not too long...
Thanks...
Try to find how to die
|
|
|
|
|
Perhaps if you show us what you have tried already and what errors you are getting, we will be able to help you a little better.
And a bit of advice, don't put "help me" in the title of your post, most users will just avoid reading it.
|
|
|
|