Search:

Type: Posts; User: Salem

Page 1 of 20 1 2 3 4

Search: Search took 0.28 seconds.

  1. Replies
    6
    Views
    133

    Compiling with warnings enabled would have told...

    Compiling with warnings enabled would have told you something was wrong from the start, without the "hours of coding".



    $ cat foo.c
    #include<stdio.h>
    void divide(int dividend, int divisor,...
  2. Replies
    8
    Views
    124

    Your file reading loop is wrong, because feof()...

    Your file reading loop is wrong, because feof() doesn't work how you expect.

    In particular, you have an fread() that will fail to read something, but you don't detect that.



    while (...
  3. Replies
    15
    Views
    212

    FFS ron77, post code without your crazy colour...

    FFS ron77, post code without your crazy colour scheme and fonts!

    Sheesh!
  4. Replies
    15
    Views
    212

    @ron77, stop posting code with that train wreck...

    @ron77, stop posting code with that train wreck colour scheme!
  5. Make the compiler do the work. char...

    Make the compiler do the work.


    char alphabet[] = "abcdefghijklmnopqrstuvwxyz";
  6. It should be scanf("%d", &a); not scanf("%d,...

    It should be
    scanf("%d", &a);
    not
    scanf("%d, &a");

    You got the end " in the wrong place.

    The compiler should have warned you.
  7. > char alphabet[26] =...

    > char alphabet[26] = "abcdefghijklmnopqrstuvwxyz";
    There is no guarantee that you're getting a \0 in your string.
    So strlen() on it is broken.
  8. So what does this do? ...

    So what does this do?


    SERCOM0_USART_Write("", 1);
    SERCOM0_USART_Write(&message[0], sizeof(message));


    If you don't see message, then try replacing all the sizeof with strlen....
  9. How about posting more than 2 lines of code. ...

    How about posting more than 2 lines of code.

    How is it called?
    How are those variables declared and initialised?

    Using sizeof() on a char array means you're going to send a \0, and that may be...
  10. Replies
    3
    Views
    192

    Well we don't have your data file, so have you...

    Well we don't have your data file, so have you run the code in a debugger?

    Put a breakpoint on
    > while(curr->next != NULL)
    and run the code.

    The debugger will stop the code when it gets to...
  11. Also here -> Passing A 2d Array To A Function,...

    Also here -> Passing A 2d Array To A Function, Using The Pointer To A 2D Array - C And C++ | Dream.In.Code
  12. Replies
    2
    Views
    283

    Why can't you look into it?

    Why can't you look into it?
  13. Replies
    10
    Views
    262

    OK, so run it in the debugger, put a breakpoint...

    OK, so run it in the debugger, put a breakpoint on line 61 and see what happens.

    Don't rely on %s telling you what's in _path
  14. Replies
    10
    Views
    262

    > And this is the output (directory has been...

    > And this is the output (directory has been modfied to ~):

    But you're not opening an absolute path.
    Opening '~/opengl_example/main.c'

    It's only your shell that understands ~ and variables...
  15. > I want to use C for web development. C is too...

    > I want to use C for web development.
    C is too low level for this.

    If you're just writing client side code, you're just going to be wasting a lot of time on low level details.
    Even if you use...
  16. Replies
    35
    Views
    963

    Here's an example. 1. Create a minimal...

    Here's an example.

    1. Create a minimal recovery set for some file.


    $ cp 20200903_055944.mp4 dummy.mp4
    $ par2create -c1 p2c_test1.par2 dummy.mp4
    Block size: 85456
    Source file count: 1...
  17. Replies
    35
    Views
    963

    > Do you happen to know what the overhead is? For...

    > Do you happen to know what the overhead is? For a 100 MByte file, how big is the ECC file(s) that go with it?
    You can choose your recovery size.


    $ par2create -c1 p2c_test1.par2...
  18. OK, so what does the compiled version of the code...

    OK, so what does the compiled version of the code do that is different to what you want it to do?

    You look at the first behaviour difference, you study the code to identify potential causes in the...
  19. Apart from your idea of "tutorial" being "random...

    Apart from your idea of "tutorial" being "random out of context forum post".

    Start with the clean copy of PacketProcessor and all the other stuff it comes with.
    Does it compile?

    Before you...
  20. Replies
    1
    Views
    164

    Duplicate of this ->...

    Duplicate of this -> https://cboard.cprogramming.com/cplusplus-programming/180376-undefined-reference-%60packetprocessor-setseqstart-unsigned-char-|.html
  21. Normally I would suggest learning some C++ to...

    Normally I would suggest learning some C++ to begin with.

    But you could try making those free functions class member functions by putting PacketProcessor:: in front of the function name - you...
  22. Replies
    4
    Views
    302

    A bit like that, but without using any global...

    A bit like that, but without using any global variables.
  23. > and remove these variables and functions One...

    > and remove these variables and functions
    One of which seems to be
    > void PacketProcessor::SetSeqStart(unsigned short val)

    However....
    in packet.cpp under the includes add


    unsigned short...
  24. Who can say without some visibility of code...

    Who can say without some visibility of code you've actually written.
  25. Is PacketProcessor one of your classes, or...

    Is PacketProcessor one of your classes, or something you've downloaded?

    A few common mistakes are
    - not implementing the function (despite mentioning it in the class)
    - getting the type wrong...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4