Search:

Type: Posts; User: Hodor

Page 1 of 20 1 2 3 4

Search: Search took 0.02 seconds; generated 57 minute(s) ago.

  1. Replies
    2
    Views
    68

    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...
  2. Replies
    30
    Views
    333

    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
  3. Replies
    30
    Views
    333

    @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)...
  4. Replies
    30
    Views
    333

    (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...
  5. Replies
    30
    Views
    333

    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...
  6. Replies
    5
    Views
    140

    Yeah there is

    Yeah there is
  7. 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...
  8. 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.
  9. Replies
    1
    Views
    124

    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...
  10. Some feedback would be nice. Anyway, good to hear...

    Some feedback would be nice. Anyway, good to hear you were successful
  11. 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...
  12. 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...
  13. 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...
  14. Replies
    7
    Views
    133

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

    I must be misunderstanding what you meant by "You...

    I must be misunderstanding what you meant by "You probably want to compare with "" instead of "\0"". Not really sure now :(



    int main(void) {
    char str[20] = "";
    return str == "" ? 0 :...
  16. Replies
    7
    Views
    133

    Regarding comparing to ""... is that allowed in...

    Regarding comparing to ""... is that allowed in C? "", is a string literal and therefore you'd be comparing serie_list[i]->serieName (an array) with a, well, string literal/pointer to string (??)
  17. @thebesthere231, make the changes suggested by...

    @thebesthere231, make the changes suggested by @stahta01 and the changes I previously mentioned. Then also change the code in buildTree to



    do {
    character = getchar();
    ...
  18. Thanks. I'm not sure how I missed those. But it...

    Thanks. I'm not sure how I missed those. But it still segfaults :/ pointNode is NULL when head != NULL. Maybe I need sleep. Edit: nevermind, I see it
  19. Regarding the segfault... $ valgrind...

    Regarding the segfault...



    $ valgrind --tool=memcheck --leak-check=full ./test
    ==3753== Memcheck, a memory error detector
    ==3753== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et...
  20. Dealing with the strWord[levelTree] problem first...

    Dealing with the strWord[levelTree] problem first (I changed the previously mentioned pointNode->count++ to head->count++ to get rid of the segfault just so I could run valgrind to ensure my sanity)...
  21. void buildTree(node* head) { char...

    void buildTree(node* head)
    {
    char character;
    node* pointNode = head;

    do {
    character = fgetc(fp); //getchar();
    character = tolower(character); //Turns a big letter...
  22. strWord[levelTree] = '\0'; Is also...

    strWord[levelTree] = '\0';





    Is also wrong (as mentioned); there's no space allocated to store that '\0'
  23. That's not what I'm saying. I'm saying that given...

    That's not what I'm saying. I'm saying that given this code:


    if( (strcmp(argv[1],r)==0) && (argc==2) ) /* This is potentially accessing argv[1] when it doesn't exist */




    What happens if...
  24. Well I've pointed out two problems already. Are...

    Well I've pointed out two problems already. Are those fixed?
  25. You can only edit your first post for a certain...

    You can only edit your first post for a certain amount of time.

    Anyway, here's your code in one file. Don't blame me if you don't like the formatting (I used AStlye to format it) or doesn't suit...
Results 1 to 25 of 492
Page 1 of 20 1 2 3 4