Search:

Type: Posts; User: john.c

Page 1 of 20 1 2 3 4

Search: Search took 0.01 seconds; generated 21 minute(s) ago.

  1. Replies
    2
    Views
    59

    From: Types - C# language specification |...

    From: Types - C# language specification | Microsoft Docs
  2. Replies
    7
    Views
    164

    So now you're too lazy to even look through those...

    So now you're too lazy to even look through those exercises to find it?
  3. Replies
    5
    Views
    106

    Am I missing something here? Are you expecting...

    Am I missing something here?
    Are you expecting strcmp("ER_CMD#P?", "ER_CMD#P9") to be 0?
    The are obviously not equal: '?' != '9'

    Maybe you mean to do something more like this:


    char...
  4. Replies
    1
    Views
    119

    Your basic design is seriously flawed. It doesn't...

    Your basic design is seriously flawed. It doesn't really make sense. Look at this:


    void LinkedList::add(char ch)
    {
    LinkedList *current = this;
    // ...
    if (current == nullptr)...
  5. Replies
    7
    Views
    164

    The basic idea is to store extra information...

    The basic idea is to store extra information before each object's storage in the buffer. Storing the size of the allocated block is the minimum amount of information. In practice, it's better to...
  6. Replies
    5
    Views
    181

    From C11 draft standard:

    From C11 draft standard:
  7. It might be a good idea to use defines in a...

    It might be a good idea to use defines in a header file.


    // header file
    #define Cmd_GetVersion "ER_CMD#T3"
    #define Cmd_GetPower "ER_CMD#P?"


    // code file
    strncpy(s_LPRS.command,...
  8. Apparently the size of a pointer on your device...

    Apparently the size of a pointer on your device is 2 bytes. So sizeof(c), where c is a pointer to char, is 2. sizeof(*c), the size of what c points to, will be 1.

    As long as TRANSMIT_SIZE is at...
  9. Thread: Issue on coding

    by john.c
    Replies
    5
    Views
    153

    You need to use strcpy to copy characters from...

    You need to use strcpy to copy characters from one string to another. You can't just use assignment.

    Assignment can be used if you are just copying pointers to strings without actually copying...
  10. Replies
    1
    Views
    104

    You need to get rid of the global variables!...

    You need to get rid of the global variables! That's just bad programming. Make a List struct, init it in main and pass it around.

    I think maybe the structure of your list is wrong. You have a...
  11. Replies
    4
    Views
    445

    Now that I think about it, my solution is pretty...

    Now that I think about it, my solution is pretty bad. I also forgot this was the C++ forum, so I didn't consider std::array.

    It does make sense that they are probably constants. For the string...
  12. Replies
    4
    Views
    445

    You can't take the sizeof an incomplete type....

    You can't take the sizeof an incomplete type.
    You can add something like this after your array definition:


    const int strings_size = sizeof strings / sizeof strings[0];

    and then in the other...
  13. Replies
    5
    Views
    162

    Qt is available under open source licenses...

    Qt is available under open source licenses (GPL2.0, GPL3.0, LGPL3.0).

    You can google for GTK forums (I know of no secret ones).
  14. Replies
    5
    Views
    162

    Qt official: Qt | Cross-platform software...

    Qt
    official: Qt | Cross-platform software development for embedded & desktop
    wikipedia: Qt (software) - Wikipedia

    GTK
    official: The GTK Project - A free and open-source cross-platform...
  15. Replies
    5
    Views
    203

    No, it doesn't compile. Zeus is confused between...

    No, it doesn't compile. Zeus is confused between C++ and C.
    Your code is correct, although using ++ is more usual.


    Passing a pointer to the first element is essentially passing the whole array...
  16. Please post actual code that you've ran then...

    Please post actual code that you've ran then copy/pasted, not something you just typed up. :tongue:

    What is inbuf? What is newline? (Presumably inbuffer and n.)
    And you have a semicolon in one...
  17. Replies
    6
    Views
    214

    Look at all three posts by this weirdo, this post...

    Look at all three posts by this weirdo, this post and the following two, all posted at about the same time.
    They are all meaningless garbage and remind me of the kind of useless add-on comments that...
  18. Replies
    15
    Views
    340

    Sure, post the GitHub link and the other stuff. ...

    Sure, post the GitHub link and the other stuff.

    @rstanley, Large multi-file programs are probably best posted as a link.
  19. It struck me as an old-fashioned style. Maybe...

    It struck me as an old-fashioned style. Maybe you're using an old book. Or have an old teacher. Whatever. :p
  20. It's the arbitrary actions of UB stemming from...

    It's the arbitrary actions of UB stemming from the uninitialized "top" pointer in "rev". It needs to be initialized to NULL.
  21. Replies
    8
    Views
    259

    You've been given more than enough information in...

    You've been given more than enough information in your thread on the other site: how read the GIF and JPG image size? - C++ Forum

    And from the code you've shown you clearly don't know what you...
  22. It's pretty obvious you didn't write that code.

    It's pretty obvious you didn't write that code.
  23. Replies
    2
    Views
    130

    It says that unsigned integers are supposed to...

    It says that unsigned integers are supposed to function the same across all implementations. It doesn't say anything about "testing for overflow of unsigned integers". In fact, you might say that...
  24. No. If curr could just be a single-level pointer...

    No. If curr could just be a single-level pointer I would've wrote it that way since it would be simpler. The reason you need the second level of indirection is that we don't want curr to hold the...
  25. The recursive version is better written like...

    The recursive version is better written like this:


    ListNode *merge2(ListNode *a, ListNode *b )
    {
    if (!a) return b;
    if (!b) return a;

    if (a->data <= b->data)
    {
Results 1 to 25 of 496
Page 1 of 20 1 2 3 4