Search:

Type: Posts; User: OldGuy2

Page 1 of 7 1 2 3 4

Search: Search took 0.01 seconds.

  1. If you love Delphi so much give Lazarus a try....

    If you love Delphi so much give Lazarus a try. It's very similar.
    Lazarus Homepage
  2. Why don't you use memset ? memset(3): fill...

    Why don't you use memset ?
    memset(3): fill memory with constant byte - Linux man page
  3. Replies
    1
    Views
    2,705

    Have a closer look at line 5. Do you want to...

    Have a closer look at line 5.
    Do you want to print the address of the compare function?

    There is no need for casting:


    int compare(const void* i, const void* j)
    {
    return strcmp(i, k);...
  4. Replies
    4
    Views
    6,791

    It's normally bad practice to use global...

    It's normally bad practice to use global variables since the can get changed from all over the code and that can make debugging very hard, it doesn't matter if they are simple vars or structs.
    It's...
  5. Replies
    24
    Views
    10,133

    What wrong results did you get, what input did...

    What wrong results did you get, what input did you use?
    Can you post the lastest code?
  6. Imagine h == 2 and b == 3. Does 6 = flaeche make...

    Imagine h == 2 and b == 3. Does 6 = flaeche make any sense?

    Doesn't your textbook tell you how to assign values to a variable ?
  7. One problem is on line 24: == is the comparison...

    One problem is on line 24: == is the comparison operator, but you should assign it to the var diagonale.
    diagonale = sqrt(pow(h,2) + pow(b,2));

    Same problem on line 31

    How did you manage to...
  8. Replies
    8
    Views
    5,002

    On Windows under Visual Studio you can have...

    On Windows under Visual Studio you can have structured exception handling for C.
    Be aware that your code won't work on other compilers.
    Structured Exception Handling (C/C++) | Microsoft Docs
  9. Switching to Linux is a very big step. Why don't...

    Switching to Linux is a very big step. Why don't you try clang or even Pelles IDE first ?
  10. Replies
    2
    Views
    3,989

    It's very easy to use the STL containers in a...

    It's very easy to use the STL containers in a poor way causing lots of allocations and deallocations and copying.
    If you show us the code we might be able to show you better ways.
  11. Replies
    11
    Views
    10,379

    Forum - C++ Forum...

    Forum - C++ Forum seems very popular
  12. Replies
    10
    Views
    9,561

    There is an overloaded version of stoi that...

    There is an overloaded version of stoi that accepst the base of the number.

    const int HEX = 16;
    stoi(num, nullptr, HEX)
    stoi - C++ Reference
  13. Replies
    6
    Views
    3,504

    When using uint64_t you know that it is an...

    When using uint64_t you know that it is an unsigned 64 bit type.
    What is unsigned long long int ? You can't answer it in general the size depends on the compiler and the architecturre 32/64 bit ot...
  14. Replies
    6
    Views
    3,504

    A few hints: unsigned long long int use...

    A few hints:

    unsigned long long int
    use uint64_t instead => include <cstdint>


    Not valid in C++
    Better use std::vector
  15. Consider using std::set_intersection. I guess...

    Consider using std::set_intersection.
    I guess you want the factors to be sorted and unique so best to store them in a std::set.
  16. It's not really clear what you want to do. Can...

    It's not really clear what you want to do.
    Can you show us the expected output with some input?
  17. A dll can have a DllMain function, not a main...

    A dll can have a DllMain function, not a main function, though it seems that it isn't necessary.
    DllMain entry point | Microsoft Docs
    PInvoke ( How to Call C from C# ) | Moy Blog
  18. Replies
    5
    Views
    3,570

    Easier way is iterate through the string from...

    Easier way is iterate through the string from right to left.


    #include <stdlib.h>
    #include <stdio.h>
    #include <string.h>
    #include <ctype.h>
    #include <assert.h>

    /*
  19. Honestly, before writing such a game you should...

    Honestly, before writing such a game you should learn about string, struct and vector which would easily solve your problems with the variables.


    struct QuizEntry // one variable for each...
  20. What's the point of this code? By using a...

    What's the point of this code?
    By using a std::vector there would be no need to worry about copy/move semantics and memory leaks.
  21. scanf leaves '\n' in the input buffer, that's...

    scanf leaves '\n' in the input buffer, that's what getchar reads so it doesn't stop for input.
    To fix put another getchar after the last scanf.
  22. That's true, however you might get more useful...

    That's true, however you might get more useful answers if you clearly tell us what you want to do in plain English.
    It also will help you to understand the problem if you write some pseudo code in...
  23. Replies
    10
    Views
    5,379

    Out of curiosity: Why so complicated ? The task...

    Out of curiosity: Why so complicated ?
    The task could easily be done like this:


    #include <iostream>
    #include <string>
    #include <list>

    using namespace std;
  24. Thread: input check

    by OldGuy2
    Replies
    9
    Views
    6,078

    One way is to check the return value from scanf:...

    One way is to check the return value from scanf:


    int num;
    if (scanf("%d", &num))
    {
    puts("Valid input");
    }
    else
    {
  25. Some other ideas: 1. embed the images as...

    Some other ideas:

    1. embed the images as resources in your .exe file.

    2. deliver the images together with your .exe file

    3. store the images on the web and download them - if you can rely...
Results 1 to 25 of 157
Page 1 of 7 1 2 3 4