|
dannysoo2020 wrote: else ((amount/1000)!=0);
This will obviously not work.
Your code does not indicate what trouble you are having. Instead of checking from smallest to largest, it would make more sense to check from largest to smallest. Have you single-stepped through it to see where things go awry?
In addition to the Java example I already provided, here is another. If you have a Basic background, see here.
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
I just wanna the amount till 9999, can it make it easier, cos i saw the code in both you gave still very complicated for me to see, sorry.
|
|
|
|
|
This should be a rough estimate:
const char *tens[] =
{
{ "twenty " }, { "thirty " },
{ "fourty " }, { "fifty " },
{ "sixty " }, { "seventy " },
{ "eighty " }, { "ninety " },
};
const char *teens[] =
{
{ "ten " }, { "eleven " },
{ "twelve " }, { "thirteen " },
{ "fourteen " }, { "fifteen " },
{ "sixteen " }, { "seventeen " },
{ "eightteen " }, { "nineteen " },
};
const char *ones[] =
{
{ "one " }, { "two " },
{ "three " }, { "four " },
{ "five " }, { "six " },
{ "seven " }, { "eight " },
{ "nine " }
};
string NumToText( unsigned int uNumber )
{
string strResult;
unsigned int uTemp;
if (uNumber >= 1000U)
{
uTemp = uNumber / 1000U;
strResult += ones[uTemp - 1];
strResult += string("thousand ");
uNumber = uNumber - (uTemp * 1000U);
}
if (uNumber >= 100U)
{
uTemp = uNumber / 100U;
strResult += ones[uTemp - 1];
strResult += "hundred ";
uNumber = uNumber - (uTemp * 100U);
}
if (uNumber >= 20U)
{
uTemp = uNumber / 10U;
strResult += tens[uTemp - 2];
uNumber = uNumber - (uTemp * 10U);
}
if (uNumber >= 10U)
{
uTemp = uNumber;
strResult += teens[uTemp - 10];
}
else if (uNumber >= 1U)
{
strResult += ones[uNumber - 1];
}
return strResult;
}
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
Any suggestions (or code snippets) that can help me build a tree from given, random paths (not necessarily existing ones, could be this\dimwit\cannot\work\that\out, what\a\doofus, etc).
The root item has already been taken care of and I'm just trying to show the (possible) connections between the directories, but I'm just going round in circles, instead of laterally.
redsagentsven
|
|
|
|
|
|
I'm not exactly sure what you are asking about here. Are you wanting to create a directory hierarchy? If so, does CreateDirectory() or SHCreateDirectoryEx() help?
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
Hi,
Does anyone know how to implement the save workspace as in Visual C++ in your MDI application. That is on restart of the app, reload all the child frames that were visible during the previous run of the app.
Thanks
Vijay
|
|
|
|
|
I have no idea about macintosh..
Programs that are made with VS6 can run on macintosh? If not, how can someone code a program in a mac?
|
|
|
|
|
You'll need to port your code to OSX. That's no easy feat. Especially if it's a windows app. Lookup cross platform development on the Internet for more details.
If you're going to code on the mac, then apple expects you to use their free XCode[^] IDE. It'll build "Universal Binaries" which will work on PowerPC and the new Intel based macs.
|
|
|
|
|
What about libraries and classes. I'm guessing that MFC aren't available. XCode has it's own classes to make coding easier, or no classes at all?
|
|
|
|
|
On OSX, there are 2 toolkits technologies : Carbon ( C++ ) or Cocoa ( Objective-C ).
Cocoa is the prefered toolkit, it offers a bit more support than Carbon; but it's designed around the Objective C language which is not easy to use if you come from a C++ background ( IMO ).
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Is there a site like "msdn.microsoft.com" to take a look or it's not that easy?
|
|
|
|
|
Vertical_Horizon wrote: I'm guessing that MFC aren't available.
You guessed right.
Vertical_Horizon wrote: XCode has it's own classes to make coding easier, or no classes at all?
Apple's Cocoa library is used for UI development. They have several other libraries too. Check out their development website.
http://developer.apple.com/[^]
If you want a cross platform library similar to MFC, then wxWidgets might be what you're looking for. Never tried it myself, but I've heard good things.
http://www.wxwidgets.org/[^]
|
|
|
|
|
I'm familiar only with c++ so the second one might be the one..
I'll take a look. Thanks
|
|
|
|
|
Yes, wxWidgets is very easy to use if you know MFC very well. There is a good start tutorial here[^]
I think the next one is already available, you have to search a little bit.
And yes, wxWidgets is really nice.
|
|
|
|
|
Take a look at Jim Crafron's VCF[^]. It should run on both Windows and Mac.
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
|
|
|
|
|
Vertical_Horizon wrote: Programs that are made with VS6 can run on macintosh?
In short, no. The instruction set for the Intel, Motorola, and PowerPC processors is different.
This year, however, Macintosh will begin using Intel processors so I do not know what that will bring in terms of compatibility. Rosetta may come into play here.
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
Hi guys ,
does any body know any good tool for the deployment of VC++ project. I mean the tool which itself adds the required DLLS and then registered them on target machine ?
I have tried Instal Sheild which comes with MS Studio 6 , but did't find it any good.
Can you please guid me to any good tool for the deployment of VC projects ???
Thankssss,
ZINC
|
|
|
|
|
Give Inno Setup a try.
"My dog worries about the economy. Alpo is up to 99 cents a can. That's almost seven dollars in dog money" - Wacky humour found in a business magazine
-- modified at 13:37 Friday 17th February, 2006
|
|
|
|
|
What about Install Shield coming with the Visual Studio
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
I have entioned in my post that I have used Instal sheild which comes with VC 6 , n i did't find any good. I want some tool which automatically adds all the dlls and registered them on target machine.
so any sugestionsss ?
thanks
zink
|
|
|
|
|
Try using NSIS script which is freeware . Use NSIS 3.0.
which is used for winap istallation
the NUllsoft installer.
Cherrs.
|
|
|
|
|
I am student currently working on a project to built an add-in for Microsoft Outlook 2003.
Actually it is to create an application that will search for a contact in outlook and automatically dial the number...
"I need help in knowing how to access the in-built functions on outlook with the help of VC++"
Sridhar
|
|
|
|
|
Make a search on google for "Outlook automation"
Results[^]
The first link is interesting I think.
|
|
|
|
|
you can have a look at this article i hope this will help you
http://support.microsoft.com/?kbid=220600
kss
|
|
|
|