![]() |
|
#1
|
|||
|
|||
using Floats and Parse'i am building a project to determine the maturity value given certain variables.
I have these lines in my project, CPP / C++ / C Code:
but when i build it brings up the following errors, 'error C2653: 'Float': is not a class or namespace name' and 'error C3861: 'Parse': identifier not found, even with argument-dependent lookup' When i change 'Float' to 'Int32' it works up until the point where you have to put in the interest which is not an integer so it causes problems... any help would be great. Thank you. Last edited by LuciWiz : 14-Feb-2005 at 01:18.
Reason: Please insert your C code between [c] & [/c] tags
|
|
#2
|
||||
|
||||
|
I am confused. It seems to be C# judging by the Data types and methods, but you use the "::" operator like in C++.
Anyway, I'll consider it C# - and I will move the thread to the appropriate forum (the .NET Forum ) as soon as you confirm reading my post. There is no Float class in C#, only float. Use this: CPP / C++ / C Code:
Best regards, Lucian __________________
Please read these Guidelines before posting on the forum "A person who never made a mistake never tried anything new." Einstein |
|
#3
|
|||
|
|||
|
it actually was C++ code,.... i am new to programming and taking an intro class... part of the code was directly from the teacher,... he later gave a hint to use floats instead of ints.... but i could not get it to work with Float or float... so i ended up using Double and it worked fine... Thank you for the reply tho,...just wanted to explain to you what happened. (and thanks for editing my post for me)
Thanks for any more help in advance. |
|
#4
|
||||
|
||||
|
Aha - Managed C++ then!
The data types were obviously from the .NET Framework, I just didn't meet many people using the controversial Manged C++. Fine then, I'll still move it to the .NET Forum Anyway, there is no Float in C++ either, only float or FLOAT, which is actually a typedef from float (so it is actually the same thing). In order to call Parse on a single precision floating number you need to use the System.Single structure. Confusing, I know... So, in the light of the new events, your code should be something like this: CPP / C++ / C Code:
I hope this works well for you, and you are welcomed to post more questions on this topic, since there is little input on Managed C++ on the forums right now. After you confirm reading this, I will move this thread to the right forum. Kind regards, Lucian __________________
Please read these Guidelines before posting on the forum "A person who never made a mistake never tried anything new." Einstein |
|
#5
|
|||
|
|||
|
Thank you very much for your help... I've been to too many forums where the more experienced users just make fun of those who don't know as much, but i must say you have been very helpful.... I ended up using Double instead of Single (i think that allows more precision,....) Either way, thank you very much. And i will be sure to ask when i get stuck again.
|
Recent GIDBlog
Meeting the local Iraqis by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The