Search:

Type: Posts; User: twanvl

Page 1 of 13 1 2 3 4

Search: Search took 0.29 seconds.

  1. Re: Anything like interfaces and abstract methods in c++?

    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...
  2. Thread: Huge Integers

    by twanvl
    Replies
    8
    Views
    857

    Re: Huge Integers

    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 :).
  3. Replies
    2
    Views
    675

    Re: Compiler Being Uber Picky

    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.
  4. Replies
    6
    Views
    627

    Re: Capitals instead of lower case?

    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...
  5. Thread: big numbers

    by twanvl
    Replies
    2
    Views
    714

    Re: big numbers

    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...
  6. Replies
    3
    Views
    831

    Re: Please compile this

    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.
  7. Replies
    2
    Views
    503

    Re: Need Class Help.

    What errors do you get?



    math cpp_math

    Is missing a semicolon.
  8. Replies
    3
    Views
    533

    Re: Unable to Trace / Break a C++ program

    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...
  9. Replies
    3
    Views
    533

    Re: Unable to Trace / Break a C++ program

    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...
  10. Replies
    2
    Views
    526

    Re: read character on string

    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().
  11. Replies
    3
    Views
    831

    Re: Please compile this

    "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.
  12. Replies
    2
    Views
    442

    Re: class Savings program

    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.
  13. Replies
    3
    Views
    606

    Re: Segmentation Fault **HELP Please**

    - 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 =...
  14. Replies
    3
    Views
    619

    Re: Get Function Size?

    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...
  15. Replies
    6
    Views
    480

    Re: Visual C++ 4.0 and 6.0

    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).
  16. Replies
    6
    Views
    480

    Re: Visual C++ 4.0 and 6.0

    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...
  17. Replies
    6
    Views
    480

    Re: Visual C++ 4.0 and 6.0

    I would suggest you download VC++ 2005 Express Edition instead. It is a much newer version, and it is free.
  18. Replies
    3
    Views
    619

    Re: Get Function Size?

    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...
  19. Replies
    4
    Views
    679

    Re: combinational test case generator

    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...
  20. Replies
    4
    Views
    679

    Re: combinational test case generator

    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:...
  21. Replies
    1
    Views
    430

    Re: Change the contents of a text file [VC++6]

    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...
  22. Replies
    2
    Views
    701

    Re: Bouncing a idea of you guys.

    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...
  23. Replies
    2
    Views
    627

    Re: What uses .vcproj?

    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.
  24. Thread: pointer help.

    by twanvl
    Replies
    2
    Views
    657

    Re: pointer help.

    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...
  25. Replies
    2
    Views
    2,128

    Re: Heap Corruption at Delete

    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...
  26. Replies
    2
    Views
    472

    Re: Searching arrays

    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...
  27. Re: question about decimal place precision (approximating pi)

    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...
  28. Replies
    3
    Views
    599

    Re: checking lowest value in array.

    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.
  29. Replies
    1
    Views
    599

    Re: Argument of type void

    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...
  30. Replies
    5
    Views
    484

    Re: Help with template function

    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...
  31. Replies
    5
    Views
    484

    Re: Help with template function

    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...
  32. Thread: Vector Erase()

    by twanvl
    Replies
    2
    Views
    525

    Re: Vector Erase

    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...
  33. Re: Creating static library in Windows (requires other static libs)

    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...
  34. Replies
    11
    Views
    933

    Re: delete registry folder,entry

    Look at the documentation of RegOpenKey, specificly at what arguments it expects.
  35. Replies
    11
    Views
    933

    Re: delete registry folder,entry

    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...
  36. Replies
    2
    Views
    3,420

    Re: Unresolved Externals

    You need to add the winsock library, winsock2.lib, to the 'additional dependencies' (project->properties->linker->input).
  37. Re: a strange error : DAMAGE: after Normal Block (#56) at 0x00411300

    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).
  38. Replies
    4
    Views
    591

    Re: Write Binary File

    Sorry, I missed that.

    You could try creating a new fstream object instead of reusing the previous one.
  39. Replies
    4
    Views
    591

    Re: Write Binary File

    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)...
  40. Replies
    8
    Views
    781

    Re: Win32 project in VS2005?

    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).
Results 1 to 40 of 500
Page 1 of 13 1 2 3 4



Click Here to Expand Forum to Full Width