User Profile
Collapse
-
why is this post sticky? just wondering -
What you want to do is easily done in .NET or java, because these languages have something known as Reflection.
C++ has no reflection but you can simulate it:
Code:class Base { public: Base * ClassFactory( ) = 0; }; class X : public Base { public: Base * ClassFactory( ) { return static_cast<Base*>( new X() );
Leave a comment:
-
Use CreateFile()
and use "\\.\\COM1: " as the file name
I googled it :P...Leave a comment:
-
-
I think the moderator comment was right, but I am a math freak and I cant help solving math problems.
Now, I am just assuming you are trying to calculate the tangencial vector to a surface when a vector hits the surface on a given point, and you already have the Normal vector of the surface at that point.
So do this:
Normalize the normal vector, hehe that sounds funny, but you have to do that. That means...Leave a comment:
-
You are trying to use the dot product formula but you are not calculating correctly the modulus of both vectors.
This is what you should do.
Calculate the dot product and store it in a double variable "x".
Calculate the modulus of the Normal vector and store it in a double variable "y"
Calculate the modulus of the Velocity vector and store it in a double variable "z"
...Leave a comment:
-
I think this would be compiler dependant.
However I remember seeing some pointer aritmetic to calculate the begining and the end of an object when loaded in memory somewhere inside the MFC source code.Leave a comment:
-
Correct, if using "w" you can only write, is using "r" you can only read. I dont know whether there is a way to open files in Read and Write mode using C standard file functions.
Win32 file functions allow opening files in read AND write mode though.Leave a comment:
-
After taking a fast look, should not you be opening the file in read mode rather than write mode?
Code:FILE *asciivalue_file; asciivalue_file = fopen("asciivalue.txt","w");//<--- should be "r"
Code:i=0; while (i != 7) { lc = fgetc(asciivalue_file);
Leave a comment:
-
You can do some old style MSDOS game using a bit of software interruptions ( 0x10 ), and accessing Video Memory at location 0xA0000.
Or you can do a Win32 based game. You would need to know the basics of WIn32 programming, and some accelerated graphics programming technology such as OpenGL or DirectX.
My advice is, just jump into programming and ask any question you might have in your way. i.e. dont try turning yourself...Leave a comment:
-
The import directive is a Microsoft compiler's propietary prepocessor directive. What this directive does is reading any COM related import library and generate a C++ header file (at pre-compilation time).
Note: Import libraries may live inside DLL or OCX files.
Inside this header file generated at precomiplation time, live the interface definitions of the COM objects included in the import library. Once having these...Leave a comment:
-
The static variable is declared as private, so its not available outside class A.
Declare it as public if you want to class B to use it or make Class B a friend class of A´s.
Also dont forget to declare the static variable somewhere in your source code.
I.e.
Code:bool classA::xyz = true;
Leave a comment:
-
Well, you can save a call to
memset(tmp_num, 0,10);
using
tmp_num[0]=0;
and doing
tmp_num[j++] = **str;
tmp_num[j]=0;
I dont know whether that would help.
Anyway, try using some optimization flag in your compiler, like -O2 or -O3 and see if your program speed improves.Leave a comment:
-
Correct.
As a side note, you would need to take a look into getEmployee when doing that change....Leave a comment:
-
You will need a C parser.
People actually make money creating parsers because they are very hard to create.Leave a comment:
-
use fflush(stdin)
Code:void vnos(struct oseba pod,FILE *fd) { printf("Vnesi ime: "); scanf("%s",pod.ime); fflush(stdin); printf("Vnesi priimek: "); scanf("%s",pod.priimek); fflush(stdin); printf("Vnesi ucni uspeh: "); scanf("%d",&pod.ucni_uspeh); fflush(stdin);
Leave a comment:
-
I would like to help but seems like doing so properly would require to take a look to many of your classes. I am going to try to assume a few things to help you:
Code:// This is a copy constructor, notice you pass an Employee object to // the constructor, the point is making an exact copy Employee :: Employee( const Employee &employee ) { FirstName = employee.FirstName; // I assume
Leave a comment:
-
-
Code:myEmployeeList.push_back(Employee());
This code creates an object in the stack, at that moment the constructor is called.
Stack objects die when the function they are created in finishes (strictly speaking they die when the scope whithin they were created in finishes), so you see the destructor being called as...Leave a comment:
-
Never get discouraged when you want to learn something.
A couple of hints:
You might want to take a look into how the FAT works.
And I think there should be a couple of software interruptions to read hard disk sectors directly.Leave a comment:
No activity results to display
Show More
Leave a comment: