Search:

Type: Posts; User: jimblumberg

Page 1 of 20 1 2 3 4

Search: Search took 0.06 seconds.

  1. Replies
    7
    Views
    205

    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)
    {
  2. Replies
    5
    Views
    277

    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.
  3. Replies
    4
    Views
    325

    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...
  4. Replies
    4
    Views
    315

    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...
  5. Replies
    4
    Views
    315

    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:




    ...
  6. 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.
  7. Replies
    4
    Views
    377

    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'...
  8. Replies
    4
    Views
    377

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

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

    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...
  10. 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...
  11. 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...
  12. Replies
    27
    Views
    1,803

    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...
  13. Replies
    27
    Views
    1,803

    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...
  14. Replies
    27
    Views
    1,803

    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...
  15. Replies
    4
    Views
    605

    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...
  16. 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.
  17. 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.
  18. 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?
  19. Exactly what do you expect to overflow? Why...

    Exactly what do you expect to overflow?

    Why would you expect it to run until it "overflows"?

    You're probably blowing away your stack with all the recursive calls.
  20. Please post a small sample of your input that...

    Please post a small sample of your input that actually matches your structure. For example it appears, from the criarficha() that the first field is a string but your file has an int as the first...
  21. Please post a small sample of your input file, 10...

    Please post a small sample of your input file, 10 lines or so should be adequate.

    Also you need to post a complete program.
  22. Show what you've tried, your latest complete...

    Show what you've tried, your latest complete program.

    Why the switch to fgets()?

    What do you think fread() brings to the table?
  23. As I have already hinted at, you either need to...

    As I have already hinted at, you either need to change your fscanf() call to match the data in your file, or change the data in the file to match your fscanf() call.
  24. Your fscanf() call doesn't match the data in the...

    Your fscanf() call doesn't match the data in the file, which will cause problems.
  25. It looks like either you're ignoring your...

    It looks like either you're ignoring your compiler's warnings/errors or you have a defective compiler.

    Here is what my compiler says about your code:



    You need to see about fixing these...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4