Search:

Type: Posts; User: jimblumberg

Page 1 of 20 1 2 3 4

Search: Search took 0.09 seconds.

  1. Replies
    4
    Views
    227

    I'd also suggest you start using C++ strings...

    I'd also suggest you start using C++ strings instead of the C-strings as a C++ string is much safer, and IMO easier to use.
  2. Replies
    4
    Views
    227

    Perhaps you meant to create buffer1 and buffer2...

    Perhaps you meant to create buffer1 and buffer2 as C-strings instead of as single characters?

    Lines 8 and 9 are creating single characters with the initial value of 80, not C-strings with a size...
  3. IMO, using high warning levels is something to...

    IMO, using high warning levels is something to recommend on most occasions.

    By the way I don't find the '=' versus "==" to be a hard to find bug, however setting your compiler to generate a...
  4. Replies
    17
    Views
    420

    I disagree, IMO, experienced programmers prefer...

    I disagree, IMO, experienced programmers prefer to have the compiler help "debug" the program. I usually use quite a few warnings when writing code, even though I will rarely have code that generates...
  5. Replies
    17
    Views
    420

    With gcc/g++ I would also suggest that you...

    With gcc/g++ I would also suggest that you specifically state the version of the standard you want to use, ie "-std=c++20" because by default gcc/g++ uses "-std=gnu++XX". I recommend sticking with...
  6. Replies
    17
    Views
    420

    Generally you should use the highest warning...

    Generally you should use the highest warning level your compiler supplies. The more warnings that are caught means the fewer potential problems you will have later.
  7. Do you know the difference between assignment "="...

    Do you know the difference between assignment "=" and comparison "=="?

    By the way your compiler should be able to help you solve this issue, insure your compiler is set up to generate warnings and...
  8. Replies
    7
    Views
    451

    Perhaps you want to print the value of each...

    Perhaps you want to print the value of each character?



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

    int main(void)
    {
  9. Replies
    5
    Views
    476

    Do you realize that the "w" open mode erases all...

    Do you realize that the "w" open mode erases all the contents of the file?

    Perhaps you should consider using one of the "append" modes instead?

    See this link for more information.
  10. Replies
    4
    Views
    518

    Be careful when printing with printf(), using the...

    Be careful when printing with printf(), using the wrong type of variable for the format specifier can invoke undefined behavior. The "%p" specifier expects a void * so you need to cast your pointers...
  11. Replies
    4
    Views
    466

    Please show the text of your project...

    Please show the text of your project requirements.

    What exactly don't you understand?

    It seems to me that you're confusing yourself by using dynamic memory, so I'd recommend you start with the...
  12. Replies
    4
    Views
    466

    By the way there doesn't really seem to be a need...

    By the way there doesn't really seem to be a need for the array of your structure, because you are only writing a single instance, so just use a single instance.

    Something more like:




    ...
  13. How did you write your input file? Normally...

    How did you write your input file?

    Normally when trying to read a "binary" file you should first write the file using binary methods.
  14. Replies
    4
    Views
    491

    Why not just use sprintf() to convert the...

    Why not just use sprintf() to convert the "number" to a string? By number I mean something like 100983.

    Do you not understand that 41 (hex) already equals 65 (decimal) which is equal to the 'A'...
  15. Replies
    4
    Views
    491

    Convert the "number" to a string and then "send"...

    Convert the "number" to a string and then "send" each character of that string.
  16. Replies
    6
    Views
    784

    Well part of the reason for the current problem...

    Well part of the reason for the current problem is that memcpy() expects "destination" to be passed by "reference" not by "value". However where are you allocating memory for those pointers in your...
  17. Correct. Sort of. But this has nothing to...

    Correct.


    Sort of. But this has nothing to do with the arguments to main(), since the arguments of main() are not constants, they are variables.

    And you need to realize that C passes...
  18. Is there a reason you're parsing that first line?...

    Is there a reason you're parsing that first line? It might be easier to just read the first line and then discard it.

    Also are you sure your file has tab characters within it? The "file" you...
  19. Replies
    27
    Views
    2,280

    Well both of these chips can probably be replaced...

    Well both of these chips can probably be replaced with a simple micro-controller.


    Decoding a 4x4 matrix keyboard is also fairly easy to decode with a simple micro-controller. IMO, it's trickier...
  20. Replies
    27
    Views
    2,280

    If your microprocessor is no longer obtainable...

    If your microprocessor is no longer obtainable you will probably need to update the rest of the chips you mentioned. Depending on the purpose of that embedded system it may be easier to go with...
  21. Replies
    27
    Views
    2,280

    No matter what it will probably be a combination...

    No matter what it will probably be a combination of pushing forward and starting over. Most of your initialization functionality will probably require total rewrite because of the new processor, also...
  22. Replies
    4
    Views
    672

    What do you mean by "isn't working"? What do...

    What do you mean by "isn't working"?

    What do you expect to happen?

    What exactly are you trying to do on line 6?

    Do you know that for most current systems a char is a signed value, meaning...
  23. Yes. Remember that function parameters all but...

    Yes. Remember that function parameters all but the last array subscript of an array must utilize a compile time constant size.
  24. Are you sure? VLA are only truly supported in...

    Are you sure? VLA are only truly supported in C99, in C11 VLA use is an optional feature, not all compilers support the use of VLA when using the current standard.
  25. Please answer the first two questions I posted. ...

    Please answer the first two questions I posted.




    You have infinite recursion so your stack overflows and the program crashes, so what is your main question?
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4