|
bhangie wrote:
Below is the code i have written, is there something wrong
Provide A Default Constructor to your class, like this
class Animal
{
public:
Animal();
Animal(const string &name, const char &sex, const string &Colour, int age);
~Animal();
---- SNip----------
}
Animal::Animal()
{
}
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Thank's for the help oaks.
Bhangie
Education begins a gentleman,
conversation completes him
|
|
|
|
|
Hi every one!
I m trying to build a project in Visual C++ using Microsoft Visual C++ 6.0 compiler. when i built a project file, this error occurred:
"This program cannot be run in DOS mode.
Error executing c:\windows\system32\cmd.exe"
some one kindly tell me y this error occurred & wts the remedy to it?
Regards
Usman Arif
Usman Arif
|
|
|
|
|
Hi,
Could someone advise me how to spy at a com port when
another existing running application is using the same com port for serial communication? Preferably with sample coding.
My intention is to build a serial port monitor
Because, it would complain error...com port in use, then my spy program will exit.
I use CreateFile Function.
thanks, Sally
|
|
|
|
|
|
Thanks, Joel.
But I have to write my own program, though I know there are already commercial products available. This is one of my work assignments.
Sally
|
|
|
|
|
hey boss,
u got to write a upper filter serial driver above the existing functional driver. refer to filter drivers in DDK.
Regards,
Adi
|
|
|
|
|
Hi guys
Im working on a program that factorises a large number into two primes. I am experiencing some problems. Im not going to explain all my code here, but in short C++ makes wrong calculations. I think it has something to do with the capacity of the variables (int, unsigned long etc). For example, it tells me that 131221*229123 = 978111.
Why is this? Ive been experiencing with various data types, but I still get these "wrong" calculations. Can anyone tell me what I should do to make this work? Remember I am working with large numbers (up to six digits).
I really appreciate the help.
|
|
|
|
|
The max value for an int = ~2.15 billion
131221*229123 = ~30 billion
Try using an __int64 variable:
Date Type Ranges
Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!
|
|
|
|
|
as Jack Squirrel said, you can do this in the calculator of your choice :
2^32 -> 4294967296 (maz value of an unsigned long)
131221*229123 -> 30065749183 (out of range...)
if you like to use an integer absolutely, use __int64. otherwize, double or long double are good enough...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
131221*229123 = 30065749183 but you get 978111.
Basically your number is truncated. Look at the hex representation.
30065749183 = 0x7000EECBF
978111 = 0x0000EECBF
Use __int64.
|
|
|
|
|
Does anyone have any suggestion on what software I should purchase to start programming in C. I am a beginner. Found that I love to write code and create things. any suggestions would be helpful. Thanks
|
|
|
|
|
Are you hoping to use C, C++ or C# ? C is a bit outdated these days, and would certainly have a steep learning curve. The C++ curve is not insurmountable, but C# would be easier. There are free options for all of these languages, but if you can get your hands on a copy of Visual Studio, for example if you're a student and can buy one at the educational price, it would be well worth your while. The help a good IDE gives you makes learning a whole lot easier. I shudder when I think of the terrible IDE's I used when I was learning, because I got them cheap ( not to imply that Microsoft are the only people to do a good IDE, but VS is excellent, the price is right if you can get education pricing, and it means you have a number of languages at your disposal out of the box ).
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hello,
You can download VS 2005 beta. It's free, and a very good tool for programming in C, C++ and C# (if you want to program in these languages).
I also got the blogging virus..[^]
|
|
|
|
|
it looks like C# is the way to go by both replies. I'll have to check on prices. I'm hoping it won't be to bad.
Thank you for the help.
|
|
|
|
|
Any body knows how to find out if the harddrive is fragmented via C++ or WMI script?
thanks in advanced.
|
|
|
|
|
|
Hi
I have a project that is dependent on some of the laiter windows platforms for some of it's functionallity so the question is is there a way of determinig the OS running.
and
how many different windows platforms are there.
can anyone help me.
G_S
|
|
|
|
|
G_S wrote:
how many different windows platforms are there.
Lots.
I'm serious - if you factor in all the various versions of IE, the service packs, the Win9x and WinNT lines, it's a frighteningly large number.
Generally, if you wish to use an API that only exists in certain versions, you're best finding a way to include the redistributable for that API along with your install. Failing that, test for the existence of the API prior to using it (for regular APIs, that usually means LoadLibrary() + GetProcAddress() rather than static linking).
For other platform-dependant functionality (such as registry locations, file formats), you're gonna have to either get more creative, or write for the lowest common denominator.
You must be careful in the forest
Broken glass and rusty nails
If you're to bring back something for us
I have bullets for sale...
|
|
|
|
|
Thanx
It's Actually only the API and specifically the tool help functions.
I was really hopping for something nicer to read.
so this leaves me with no way around the LoadLibrary ,GetProcAddress ..
Thank you anyway
G_S
|
|
|
|
|
G_S wrote:
is there a way of determinig the OS running.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/osversioninfo_str.asp[^]
But like Shog said, if you use unsupported API's, then you need to dynamically load them, or your app won't run, even if you never run the code that calls them. The alternative is to write your own versions. I did that with TransparentBlt and AlphaBlend many years ago, so I could support W95 and still call them.
G_S wrote:
how many different windows platforms are there.
Assuming you start with W95, there's W95, W98, NT4, WME, W2000, WXP. Then W98 has service pack 2 to consider, that added a lot, from memory.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thank you for the link.
So the best work around the dependencies is to dynamically load and test for the functins.
Thanks for the anwser this helps.
G_S
|
|
|
|
|
No, the best way is to use the link I gave you to find out what OS you have, then to dynamically load the functions and only allow the code to use them based on the results of that test, which will have told you if they are present, based on OS version. There's only one test involved, the dynamic loading is because otherwise Windows will try to load the functions, even if they don't exist, regardless of the fact that your code deals with that problem for you.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I use this code snippet
Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!
|
|
|
|
|
Hiya
I have a variable that shoud return a value of say... 50. Instead it's returning 49.9999999956 which may sound pretty good but I need the 50. I found this thing in the Std library which is an enum called float_round_style that includes something called round_toward_infinity ... but I can't find how to actually use the durn code, an example or anything other than the description . Can anyone tell me how to use it? Is there any other easier way to acomplish what I want?
Thanks!!!
|
|
|
|