Search:

Type: Posts; User: Hodor

Page 1 of 20 1 2 3 4

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

  1. Well, you've already done it. Remove line 22 (the...

    Well, you've already done it. Remove line 22 (the printf in the loop) and change line 30 to simply print the value of a

    Edit:


    $ factor 600851475143
    600851475143: 71 839 1471 6857


    You're...
  2. Replies
    9
    Views
    136

    I'm not sure what it means either. But compiling...

    I'm not sure what it means either. But compiling with -pedantic both clang and gcc emit a warning. In the case of gcc: warning: ISO C does not allow extra ‘;’ outside of a function [-Wpedantic]
  3. Actually you don't need to test for primeness at...

    Actually you don't need to test for primeness at all for this problem. I think what the OP is trying to do is this:



    Given a number "num"
    Start with factor = 2

    while num > 1
    if num %...
  4. I wasn't criticizing you I was criticizing the ...

    I wasn't criticizing you I was criticizing the website. By "the code above" I was referring to the code in the links in my previous message, not your code; sorry that I didn't write that more...
  5. Replies
    14
    Views
    166

    Regarding this. I'm responding to you, @awsdert...

    Regarding this. I'm responding to you, @awsdert and not laserlight.

    I've taken the time to download and debug your code dumps before even though I normally wouldn't unless I was involved in the...
  6. Replies
    14
    Views
    166

    In my experience nearly every valid use of goto...

    In my experience nearly every valid use of goto (which in C is a "local" jump so not as bad as something that can jump anywhere in the program) is almost always a forward jump. E.g. for handling...
  7. Replies
    2
    Views
    92

    You only need 1 bit to produce music (a single...

    You only need 1 bit to produce music (a single bit of 0 or 1) not 7:

    YouTube

    Probably 8 bit (using just the PC speaker):

    YouTube

    With a rPi and a $0.50 ADC (8 bit) and a $0.50 DAC I...
  8. Replies
    14
    Views
    166

    I didn't mention recursion. A simple loop would...

    I didn't mention recursion. A simple loop would suffice (iteration)
  9. Replies
    27
    Views
    315

    And how are we supposed to help if you don't even...

    And how are we supposed to help if you don't even know what it (ARES) is? Even ignoring that, why do you have a "professor" teaching mathematics that would be more appropriate for an 11 or 12 year...
  10. Replies
    14
    Views
    166

    while ( read( handle->pagesFd, line, 1 ) != 1 ) {...

    while ( read( handle->pagesFd, line, 1 ) != 1 ) {
    if ( line[0] == '\n' )
    goto next_page;




    This is not a good use of goto. The general advise is to avoid using...
  11. Replies
    27
    Views
    315

    Put them on.. ares? What's ares?

    Put them on.. ares? What's ares?
  12. Replies
    4
    Views
    146

    Is that pseudocode or have you been skipping...

    Is that pseudocode or have you been skipping class? Also, the problem description seems a bit vague. Is the description your interpretation of the description or the actual description? Are the...
  13. Replies
    30
    Views
    380

    I'm sure you're allowed to look at it without...

    I'm sure you're allowed to look at it without causing license issues. It's pretty complicated though so that it supports more than just Linux
  14. Replies
    30
    Views
    380

    @awsdert I'm sorry if my last comment sounded...

    @awsdert I'm sorry if my last comment sounded rude. It's just that I'm not used to seeing C written in the way that you write it. I guess I'm just used to seeing C or C++ (or whatever language)...
  15. Replies
    30
    Views
    380

    (void)sscanf( full->block, "%s%*[\t]%s[^\n]", ...

    (void)sscanf( full->block, "%s%*[\t]%s[^\n]",
    (char*)(key->block), (char*)(notice->name.block) );


    Unfortunately that code is almost certainly wrong. It will not read things like Uid...
  16. Replies
    30
    Views
    380

    Why is your sscanf format string different to...

    Why is your sscanf format string different to what christop wrote? I'd prefer "%[^:]:%*[\t]%[^\n]" because yours won't handle process names that have a space in them (it discards the value if there...
  17. Replies
    5
    Views
    168

    Yeah there is

    Yeah there is
  18. I used the library I linked to years ago and from...

    I used the library I linked to years ago and from what I can recall I didn't write a driver for the device, per se, but sent the library the device's VendorId and DeviceId to initialise things and...
  19. You could try this library: GitHub -...

    You could try this library: GitHub - signal11/hidapi: A Simple library for communicating with USB and Bluetooth HID devices on Linux, Mac, and Windows.
  20. Replies
    1
    Views
    156

    That's a bit weird. The version of SDL_bgi that I...

    That's a bit weird. The version of SDL_bgi that I found seems to have a font hardcoded in... although that is an SDL error. You might need to install the library sdl2-ttf (the centos package name...
  21. Some feedback would be nice. Anyway, good to hear...

    Some feedback would be nice. Anyway, good to hear you were successful
  22. There are a few ways to do what you want. The...

    There are a few ways to do what you want. The first problem I see with your printBits function is that it assumes that unsigned long is 32 bits. On my system it's not 32 bits. One way might be...
  23. I changed to int because all the character...

    I changed to int because all the character functions like isspace() and isalpha() expect an int -- not to mention that getchar returns an int. You can probably get away without changing those...
  24. I don't know. I didn't get any double frees. Did...

    I don't know. I didn't get any double frees. Did you change anything else in the meantime? I'm still not convinced that it's creating a tree structure like you want it to but that's something else...
  25. Replies
    7
    Views
    143

    I didn't think it was legal C but I was genuinely...

    I didn't think it was legal C but I was genuinely confused by what you'd written and hadn't written the test code at the time I asked the question; no other reason.
Results 1 to 25 of 492
Page 1 of 20 1 2 3 4