Search:

Type: Posts; User: thmm

Page 1 of 5 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    1
    Views
    126

    Much better to ask in English. Not many people...

    Much better to ask in English. Not many people here understand German.
  2. Replies
    3
    Views
    182

    The problem is the line if...

    The problem is the line if (strcmp(que[i],str[j])){
    strcmp returns 0 if the string are equal.
  3. Maybe you should set a breakpoint on line 12 and...

    Maybe you should set a breakpoint on line 12 and inspect your arrays.
    Maybe one of your pointers or both are invalid or you access them out of range.
  4. Replies
    1
    Views
    160

    It depends how you store your customers and...

    It depends how you store your customers and orders.
    If you show us the code we probably can offer some advice.
  5. Replies
    6
    Views
    267

    Are you not getting confused by so many types and...

    Are you not getting confused by so many types and variables ? At least I get.
    Why not just using 2 types and one var for the image?
    Also 2 separate function to load and save the image would be much...
  6. Replies
    6
    Views
    267

    One obvious error is on lines 184-190. You delete...

    One obvious error is on lines 184-190. You delete your pointers in the wrong order. It should be in reverse order of allocating them.
  7. Thread: Code refactor

    by thmm
    Replies
    5
    Views
    396

    I would get rid of this C-style arrays and use...

    I would get rid of this C-style arrays and use std::array.
    You also could use std::string_view instead of std::string.
  8. Replies
    7
    Views
    319

    Why don't your forget about the image for a...

    Why don't your forget about the image for a little while and focus on just arrays ? Once you understand how it works you can integrate your knowledge into the image project


    #include <stdio.h>
    ...
  9. Replies
    17
    Views
    447

    How do you compile your code ? Can you post you...

    How do you compile your code ? Can you post you build script ?
  10. Just check if value > 0 and < 1 and return 1

    Just check if value > 0 and < 1 and return 1
  11. Replies
    17
    Views
    447

    Still warnings and errors left. VS 2019 with C17...

    Still warnings and errors left. VS 2019 with C17 standard and /W4
  12. Replies
    2
    Views
    162

    What's wrong with that? It's easy to write and...

    What's wrong with that? It's easy to write and understand.
  13. Why don't you test it with the values from...

    Why don't you test it with the values from john.c's example and see if you get the same results?
  14. Replies
    4
    Views
    203

    You need to compile with warnings: main.c:18:45:...

    You need to compile with warnings:
    main.c:18:45: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘double’ [-Wformat=]
    18 | printf("\nIndex = %d\t\tboil point =...
  15. Thread: C++ vs Python

    by thmm
    Replies
    3
    Views
    484

    I also would recommend starting with Python since...

    I also would recommend starting with Python since it's much easier to learn.
  16. Replies
    3
    Views
    393

    You can do some form of OO in C. ...

    You can do some form of OO in C.
    Object-Oriented Programming (OOP) in C | Codementor


    What kind of problems ?
    Is there a reason why you don't want to move on to C++ ?
  17. Replies
    3
    Views
    282

    You need to enable warnings, this warns at the...

    You need to enable warnings, this warns at the online compiler:
    -Wall -Wextra -Wpedantic -Werror -O2 -fsanitize=address

    Output:

    main.c:6:12: error: array subscript 111 is above array bounds...
  18. The code compiles and runs on VS2019 and GCC...

    The code compiles and runs on VS2019 and GCC (tdm64-1) 9.2.0 on Windows 8.1.
  19. Have a look at _splitpath: _splitpath,...

    Have a look at _splitpath:
    _splitpath, _wsplitpath | Microsoft Docs
  20. Replies
    18
    Views
    760

    If you don't mind using the Win API then have a...

    If you don't mind using the Win API then have a look here: c - Printing a file in Windows - Stack Overflow
    and scroll down down to 2 Answers.
  21. You need to enable warnings, for example: -Wall...

    You need to enable warnings, for example:
    -Wall -Werror -Wpedantic -std=c99
    main.c:17:5: error: statement with no effect [-Werror=unused-value]
    17 | (*fp);

    The correct way: fp(); on...
  22. I guess each compiler might implement it...

    I guess each compiler might implement it differently. If it is faster only a benchmark can tell.
    To test it easily and quickly, have a look at Quick C++ Benchmarks
  23. Replies
    7
    Views
    434

    The first part is easy. You need to open the...

    The first part is easy.
    You need to open the input with a std::fstream and open the output file with a std::ofstream. Then you read the lines with std::getline. To check if a line contains [PERFECT]...
  24. In case someone is interested. The ...

    In case someone is interested. The <type_traits> header has a std::is_same type already.
    std::is_same - cppreference.com
  25. Thread: Thread exercise

    by thmm
    Replies
    2
    Views
    334

    Thanks Salem, not sure where the ; came from.

    Thanks Salem,

    not sure where the ; came from.
Results 1 to 25 of 116
Page 1 of 5 1 2 3 4