Search:

Type: Posts; User: john.c

Page 1 of 20 1 2 3 4

Search: Search took 0.04 seconds.

  1. Replies
    24
    Views
    5,073

    What do you mean by with `#here` strcspn says...

    What do you mean by with `#here` strcspn says the position is 0, so it works.

    EDIT:
    If file[x] is a single character (I don't know what the & is for), then you could use strchr backwards,...
  2. Replies
    24
    Views
    5,073

    strcspn does what you want. The 'c' stands for...

    strcspn does what you want. The 'c' stands for compliment, and it counts how many leading characters of your string are not any of the given characters. It returns the length of the string if none of...
  3. Replies
    3
    Views
    2,912

    Try one of these: 0x00ff58 Begin 0x00ff9d...

    Try one of these:


    0x00ff58 Begin
    0x00ff9d KP_Begin

    It's from the list here: https://github.com/linuxmint/gtk/blob/master/gdk/keynames.txt
    Here is the section with the above codes in it:
  4. Replies
    4
    Views
    2,593

    Depending on your system you may also need to...

    Depending on your system you may also need to define _POSIX_C_SOURCE before including stdio.h to use fileno:


    #define _POSIX_C_SOURCE
    #include <stdio.h>
  5. So now just add in a counter. Why are you...

    So now just add in a counter.

    Why are you using such a stupid function? It's just:


    void f(int a) {
    return a >= 1 ? 1 : a;
    }
  6. Replies
    3
    Views
    8,466

    Hardware problems can be very flaky. Could just...

    Hardware problems can be very flaky.
    Could just be something a little loose.
    In any case, make sure you back everything up!
  7. 1. There is a hidden startup function: ...

    1. There is a hidden startup function:


    startup:
    ...
    call main
    ...
    exit process ("return" to operating system) with exit system call

    2. Yes, of course it's the same.
  8. Replies
    13
    Views
    4,496

    Compilation unit 1: #include ...

    Compilation unit 1:


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

    // tell this compilation unit about the existence of function f2
    // in another comp. unit
    void f2();
  9. Replies
    8
    Views
    3,185

    This is even less code: #include ...

    This is even less code:


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

    typedef struct Tree {
    int value;
    struct Tree *left, *right;
    } Tree;
  10. Replies
    8
    Views
    3,185

    You are still ignoring one warning (unused...

    You are still ignoring one warning (unused variable d).

    Also, this is a strange comment:


    Why do you malloc one random node when you store all the others on the stack?
    You could just say:

    ...
  11. Replies
    11
    Views
    1,494

    @EmVee, the s after %[^\n] is incorrect. Also,...

    @EmVee, the s after %[^\n] is incorrect. Also, you don't need the kevin and maik objects. You can assign directly to people.


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

    typedef struct
    {
    ...
  12. Replies
    5
    Views
    2,941

    That's a good point. I'm assuming he is using...

    That's a good point. I'm assuming he is using mingw. As long as he installed it with the package manager #include <SDL/SDL.h> should work fine.
  13. Replies
    11
    Views
    1,494

    cs50.c (and its header file cs50.h) consists of 6...

    cs50.c (and its header file cs50.h) consists of 6 functions for entering a character, string, int, long, float, or double, with a prompt and some error (e.g. range) checking. It is not important.
    ...
  14. Replies
    5
    Views
    2,941

    Probably mingw-w64-x86_64-SDL2

    Probably mingw-w64-x86_64-SDL2
  15. The object is defined inside a function, not...

    The object is defined inside a function, not inside the struct, so there's nothing recursive about it.
    It would be recursive (and impossible) if it was like this:


    struct A {
    A a; //...
  16. Replies
    19
    Views
    16,195

    Salem's first post showed you the line. Look at...

    Salem's first post showed you the line. Look at the very end of the line.
  17. Replies
    3
    Views
    4,716

    Does anything from the following help: c++ -...

    Does anything from the following help:
    c++ - "relocation R_X86_64_32S against " linking Error - Stack Overflow
  18. Replies
    2
    Views
    6,066

    Presumably his VB file has fixed-length records,...

    Presumably his VB file has fixed-length records, with fields padded with spaces (or with some other character) on the right. So it is essentially a binary file.
    I think he just wants to read these...
  19. Replies
    4
    Views
    8,440

    This seems to work for me. // gcc -std=c11...

    This seems to work for me.


    // gcc -std=c11 -Wall decrypt.c -lssl -lcrypto
    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    #include <openssl/conf.h>
    #include <openssl/evp.h>...
  20. Replies
    6
    Views
    6,103

    The classic book:...

    The classic book: https://www.cs.rit.edu/~ats/books/ooc.pdf
  21. Replies
    4
    Views
    8,440

    You asked for salt but didn't supply it to...

    You asked for salt but didn't supply it to EVP_BytesToKey(). You just passed NULL, which means no salt.
    The salt is stored in the encrypted file as bytes 8 to 15 (the 8 bytes right after Salted__)....
  22. Replies
    6
    Views
    3,477

    My C precedence cheat sheet, designed to be very...

    My C precedence cheat sheet, designed to be very small.
    All operators in a category are the same precedence, except for Binary.
    In the Binary category, operators lower down are lower, as are...
  23. Replies
    5
    Views
    6,329

    Here is some input/output for my first try of...

    Here is some input/output for my first try of your program:


    hello there this is a string
    Please type the string to tokenize.
    hello
    there
    thise
    isise
    asise
  24. I agree with Linus Torvalds that Hungarian...

    I agree with Linus Torvalds that Hungarian notation (of the Systems type, which you are advocating) is brain-damaged.
    Hungarian notation - Wikipedia

    And it is not easier to read a program with...
  25. Replies
    17
    Views
    11,311

    In C, character literals are ints, so '\0' is...

    In C, character literals are ints, so '\0' is identical to 0. Even if char literals weren't ints (as in C++), assigning '\0' to an unsigned data type will still yield 0.
    You could use the value -1,...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4