Search:
Type: Posts; User: twanvl
Search:
Search took 0.29 seconds.
-
Yes, C++ has abstract methods, usually called "pure virtual functions":
class X {
virtual int myFunction(stuff) = 0;
};
The "=0" declares that there is no implementation, so it is an...
-
The number should fit into a long or "long long". However, you might not want to wait for your computer to do this much work :).
-
An error just after a #include directive is usually a result from something in the header file. My first guess would be missing a semicolon after a class...{...} declaration.
-
The reason for BOOL is that C does not provide a built in boolean type (C++ does). So many libraries made their own, often called BOOL, which is actually a typedef for int. The C++ bool type can be...
-
A trilion will fit in a 64 bit integer. Depending on the compiler the data type for this is 'long long' or '_int64'.
If you want even bigger numbers things become harder. C++ does not support...
-
Strings in VB are BSTRs. To be able to use your function you will need to change it so it accepts and returns that type.
-
What errors do you get?
math cpp_math
Is missing a semicolon.
-
Strange. The only reason I can think of is that your program is compiled without debugging support, or that the program database has somehow become corrupted.
The error you get with...
-
To be able to use breakpoints make sure you 'debug' your program (F5) and don't run it (Ctrl+F5).
To get a console window your project must be a console project...
-
n=line.length() is an assignment to n, you should compare instead.
For all characters in the string, n should be less than line.length().
-
"unresolved external symbol" means the linker is unable to find a function or global variable. The error message should give the name of the function in question.
-
What should a 'class Savings' program do?
Is this some kind of assignment/homework?
If so: We will not give you the answer, but we can help with specific questions, bugs or errors.
-
- Please put [code] tags around your code
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char **argv) {
char *TEMPORARYSTRING; char *MYSTRING =...
-
This is simply not possible. Just use a dll.
Would there by any advantage of injecting a single function (aside from not having two separate files)? The function would be injected into another...
-
I will repeat:
VC++ 200* does not require that you use .NET code. The compiler supports both managed C++ (which compiles to MSIL) and plain old C++ (which compiles to native executables).
-
While the Visual Studio IDE requires .NET to be installed on your computer, the programs you make with it do not need it. Microsoft just calls it ".NET" because their marketing department likes to...
-
I would suggest you download VC++ 2005 Express Edition instead. It is a much newer version, and it is free.
-
What do you mean by function size? The number of bytes the assembly code takes up? What about internal calls to other functions, data used, etc. ?
There is no guarantee that &func gets you the...
-
The trick is to use recursion.
Say you have n arrays A of items, numbered 0 to n-1.
Now you write a function 'combinations(i)' that generates all combinations of the arrays i to n-1.
Clearly, if...
-
Something like:
for (int i = 0 ; i < #of-items-in-A ; ++i) {
for (int j = 0 ; j < #of-items-in-B ; ++j) {
for (int k = 0 ; k < #of-items-in-C ; ++k) {
printf("Combination:...
-
Why on earth do you need to reboot after installing each package?
I would suggest writing a new file containing a list of everything that is installed, so:
- read "package2" from "todo" text file...
-
A running process is more then just the ram and register states, you also somehow need to transport operating system handles like threads, files, sockets, hooks, etc. I doubt this is possible without...
-
Visual C++ 6.0 has rather poor support for some of the advanced features of C++. I suggest you update to a newer version. You can download the express edition of visual studio 2005 for free.
-
A string is represented as a pointer to the first character, so it already is a pointer. You should simply say "temp = str". "&str" gives you a pointer to the string itself, which can be used if you...
-
Handles = (new cbk_Image[FrameCount]());
..
Handles[FrameCount].Handle = 0;
You are writing to something outside the array (indices range from 0 to FramCount-1), this is detected when deleting...
-
The stl has functions lower_bound and upper_bound that also perform a binary search, and that do return a pointer (an iterator) to the found element. I would suggest you always use binary search, for...
-
The problem is not doubles, it is that the series you are using converges very slowly, see mathworld. Also, a double can only ever hold around 15 or 16 decimal digits (52 binary digits). The value of...
-
How about sorting the array first, and then maintaining an index into the sorted array. All the function then has to do is increment the index and return the right item from the sorted array.
-
You are trying to use a pointer-to-a-member-function as a pointer-to-a-normal-function. This is not possible in C++. Either declare the function static (which would make it equivalent to a normal...
-
Not at all, you only have to 'repeat' the bit that is different. You can call overloaded functions, and even other template functions, from a template function:
template <class T>
void...
-
In a template function all code is compiled for each type. So each of the branches of the if statement is compiled, even if they are never executed. The solution in this case is to handle the input...
-
You need to remove it from the vector manually. Don't ever call destructors yourself! The destructor will be called when the element is removed from the vector, if you call the destructor as well, it...
-
You can't link static libraries into other static libraries (at least not as far as I know). The project using the library will have to link to all the other libraries you need as well. If you are...
-
Look at the documentation of RegOpenKey, specificly at what arguments it expects.
-
1. If your code does not compile, please post the error message(s).
2. A registry key is not a file, you can not use fopen or remove on it, use RegOpenKey and RegDeleteKey instead.
3. Why are you...
-
You need to add the winsock library, winsock2.lib, to the 'additional dependencies' (project->properties->linker->input).
-
This error is not happening because you free something. It means that you wrote outside the allocated region of memory, free checks for this (in debug builds).
-
Sorry, I missed that.
You could try creating a new fstream object instead of reusing the previous one.
-
if (fi_utilizador.fail()) {
// write stuff
}
You only write the contents when fail is true, so only if there is an error. You should use if(!fi_utilizador.fail()) or simply if(fi_utilizador)...
-
Are you sure it is the .NET framwork you need? Normal C++ programs compiled with VS2005 also need a runtime library, msvcrt80.dll (or something like that).
|
Click Here to Expand Forum to Full Width
|