Search:

Type: Posts; User: thmm

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. Replies
    1
    Views
    50

    Hi and welcome to the forum.

    Hi and welcome to the forum.
  2. Why do you want to make your life more difficult?...

    Why do you want to make your life more difficult?
    C++ has a steeper learning curve but it's much easier to use once you have learned the basics.
  3. Replies
    1
    Views
    123

    What is the question / problem ? A few...

    What is the question / problem ?

    A few remarks:
    - compile with all warning enabled.
    - objects should be passed as ref or const ref to avoid copying them.
    - you should check if the files...
  4. Replies
    35
    Views
    931

    What Windows do you use? Under Windows 10 you...

    What Windows do you use?
    Under Windows 10 you can enable long filenames with a length of 32,767 chars
    Enable long file name support in Windows 10 | IT Pro
  5. Replies
    35
    Views
    931

    Wouldn't it be an option to store the checksum in...

    Wouldn't it be an option to store the checksum in the filename ?
  6. Replies
    35
    Views
    931

    It works with the dirent header from above link....

    It works with the dirent header from above link.
    Just 1 warning: main.c(42,28): warning C4133: 'function': incompatible types - from 'stat *' to '_stat64i32 *'
  7. Replies
    35
    Views
    931

    No, Visual Studio doesn't have dir.h. stat.h...

    No, Visual Studio doesn't have dir.h.

    stat.h is in sys/stat.h
  8. Replies
    3
    Views
    320

    Sounds you added a project to an existing...

    Sounds you added a project to an existing solution. Did you add the references to the other projects in the solution?
    What version of Visual Studio do you use?
    There are books about Visual Studio...
  9. Thread: static array list

    by thmm
    Replies
    5
    Views
    329

    To add first digit => array[0] = 1 To add second...

    To add first digit => array[0] = 1
    To add second digit => array[1] = 2
    and so on until 5th digit which will be in array[4]

    To print the array use a simple for loop.
  10. Thread: Pointers stuff

    by thmm
    Replies
    4
    Views
    732

    Shouldn't this post be in the C section? It's not...

    Shouldn't this post be in the C section? It's not C++.
  11. Replies
    3
    Views
    548

    I am not sure if it is worth for a beginner to...

    I am not sure if it is worth for a beginner to bother about.
    But if you insist, there is an example: C library function - setvbuf() - Tutorialspoint
  12. Thread: Binary file

    by thmm
    Replies
    11
    Views
    923

    As far as I see it seems ok, but I am not an...

    As far as I see it seems ok, but I am not an expert.
  13. Thread: Binary file

    by thmm
    Replies
    11
    Views
    923

    I guess the op wants to run it only on his...

    I guess the op wants to run it only on his machine so this assumptions are justified.
  14. Thread: Binary file

    by thmm
    Replies
    11
    Views
    923

    Looks better now, but one problem remains. if...

    Looks better now, but one problem remains.

    if (file1 == NULL && file2 == NULL && file3 == NULL) {
    Shouldn't the conditions be || since if one file can't be opened there is no point to continue.
  15. Thread: Binary file

    by thmm
    Replies
    11
    Views
    923

    book.category == "Software Engineering" This...

    book.category == "Software Engineering"
    This doesn't not work. To compare strings you need to use strcmp.

    Your compiler should warn you.
    gcc -Wall -Wextra "binary.c" -std=c99 -o file_demo.exe...
  16. Why not ? From a OO point a player has an...

    Why not ? From a OO point a player has an inventory.
    I would rather decouple the player from the inventory, the inventory doesn't need to know the player class.
  17. Replies
    10
    Views
    1,297

    If you have an abstract function in the base...

    If you have an abstract function in the base class you need a virtual constructor.
    c++ - When to use virtual destructors? - Stack Overflow

    I also would replace the dynamic array with a...
  18. Replies
    12
    Views
    672

    What is the problem? Does it crash? Does it...

    What is the problem?
    Does it crash?
    Does it allow more than 7 tries?
    Doesn't it guess it at all?

    One problem I see is that you set high to 100, but the user can enter sth. like 55.
  19. I think you need to learn how to enable warnings...

    I think you need to learn how to enable warnings in your code flags. Your code has quite a few errors.

    clang -Wall -Wextra -Wshadow -Wpedantic -Werror -std=c99 -fsanitize=address,undefined -c...
  20. Replies
    2
    Views
    695

    Also posted here: C Programming Linked List - C...

    Also posted here:
    C Programming Linked List - C And C++ | Dream.In.Code
  21. Thread: Composition

    by thmm
    Replies
    11
    Views
    1,259

    @laserlight, I just wanted to show an...

    @laserlight,
    I just wanted to show an alternative way to do certain things.
    I don't claim that it is better.
    Not needing inheritance is a just a nice side ffect.
    I guess that not using virtual...
  22. Thread: Composition

    by thmm
    Replies
    11
    Views
    1,259

    An alternative without virtual functions and...

    An alternative without virtual functions and pointers is to use std::variant and std::visit - since C++17.


    #include <iostream>
    #include <vector>
    #include <variant>


    class Vehicle
    {
  23. Replies
    24
    Views
    2,906

    VS 2019 16.8.4 gives me this warning with /W4:...

    VS 2019 16.8.4 gives me this warning with /W4: warning C4189: 'i': local variable is initialized but not referenced
    You probably need to enable Code Analysis on Build under Code Analysis in the...
  24. Replies
    9
    Views
    1,405

    That was my idea: #include #include...

    That was my idea:


    #include <stdio.h>#include <string.h>


    void repeat(const char* input, char *output)
    {
    int n = 0;
    char buffer[32] = {'\0'};
  25. Thread: Just starting

    by thmm
    Replies
    17
    Views
    1,653

    I don't think it has anything to do with the...

    I don't think it has anything to do with the language, it has more to do about thinking clearly. Python would be easier to learn because you don't need manual memory management, it also has build-in...
Results 1 to 25 of 70
Page 1 of 3 1 2 3