Search:

Type: Posts; User: Hodor

Page 1 of 20 1 2 3 4

Search: Search took 0.01 seconds.

  1. Thread: Pointer question

    by Hodor
    Replies
    6
    Views
    70

    #include int main (void) { ...

    #include<stdio.h>

    int main (void)
    {
    int number = 10;
    int *pointer;

    pointer = &number;

    printf("The size of an int is %zu\n", sizeof(int)); /* added this line just...
  2. Replies
    7
    Views
    173

    For some reason I found this problem interesting...

    For some reason I found this problem interesting so I did some more testing. I modified the gcd function to make it clearer (the new version might be faster but not significantly and the call to...
  3. Replies
    7
    Views
    173

    Well, I still can't find a good reference....

    Well, I still can't find a good reference. However I did find this paper (https://pages.mtu.edu/~shene/PUBLICATIONS/1997/Array-Rotation.pdf) (the paper is linked to from the Author's web page...
  4. What a crappy way to structure a program (just my...

    What a crappy way to structure a program (just my opinion)
  5. Replies
    4
    Views
    75

    In your original code float mod(int...

    In your original code



    float mod(int height)
    {
    float area,result;

    result = (area*height)/6.0;
  6. Replies
    3
    Views
    84

    Are you sure you're checking for primes?

    Are you sure you're checking for primes?
  7. Replies
    7
    Views
    173

    Ok, since you've provided code I decided I'd...

    Ok, since you've provided code I decided I'd provide some as well. I haven't really tested either of these extensively but I think they're ok.

    Attempt 1 (the obvious way)


    #include <stdio.h>...
  8. Replies
    7
    Views
    173

    I'm assuming that this is a student project so if...

    I'm assuming that this is a student project so if it's not, please forgive me. But if it is, for student tasks like these the students are usually expected to not use library functions like strcpy...
  9. Replies
    9
    Views
    178

    Thanks. I missed that. Xaviou is nice to make...

    Thanks. I missed that. Xaviou is nice to make those builds available.

    Edit: for such a widely used open source project you'd think some company would buy a couple of the devs an apple or two (or...
  10. Replies
    1
    Views
    59

    First, line 20: for (i = 0; i < SIZE;...

    First, line 20:



    for (i = 0; i < SIZE; i++){


    is missing a closing brace (left curly brace) so the code you've supplied couldn't possibly even compile.

    Second, you may want to review...
  11. Replies
    9
    Views
    178

    You might be right, but I did look at the nightly...

    You might be right, but I did look at the nightly releases (at Nightly builds) and saw no builds for OSX -- only Windows builds. But you're right, I'm not intimate with the project so there might be...
  12. Try void myprint(const short *src, size_t...

    Try


    void myprint(const short *src, size_t len)
    {
    int i;
    for(i = 0; i < len; ++i) printf("%d\n", src[i]);
    }

    int main(void)
  13. There are no (yep, a total of zero) CVE entries...

    There are no (yep, a total of zero) CVE entries related to sentinel values being bug-prone or a security risk; if you don't believe me, have a look.

    Knuth discusses sentinel values (and also what...
  14. Citation needed :P

    Citation needed :P
  15. Replies
    9
    Views
    178

    There has been no binary (i.e. compiled) release...

    There has been no binary (i.e. compiled) release of C::B since 2013; I'd hardly call that "maintained"
  16. Thread: Slow forum?

    by Hodor
    Replies
    11
    Views
    490

    I've found the last few days fine. For the...

    I've found the last few days fine. For the previous couple of weeks the forum was reporting at least 8000 simultaneous users and up to 10000. Now it's back to a reasonable 300-500
  17. Replies
    4
    Views
    120

    I should also add that if you can't already do...

    I should also add that if you can't already do it, teach yourself to convert hexadecimal to binary in your head (and vice versa); this is easy because each hex digit (0-F) is only 4 binary digits and...
  18. Replies
    4
    Views
    120

    You can start here: Bit Twiddling Hacks...

    You can start here: Bit Twiddling Hacks

    Note that not everything there is portable or even necessarily faster than what a modern C compiler on a modern CPU would produce, but, hey, gotta start...
  19. Why does the first comment of your program say ...

    Why does the first comment of your program say



    //Draw a single line of fiver uppercase Xs using two kinds of count-controlled loops


    and then proceed to use '+', '-', '|' and ' '...
  20. I'm pretty sure I agree with Salem Edit: gcc...

    I'm pretty sure I agree with Salem

    Edit: gcc even warns you about it :/



    #include <stdio.h>

    int main(void)
    {
  21. Replies
    7
    Views
    180

    Oh those globals. Yeah, they seemed reasonably...

    Oh those globals. Yeah, they seemed reasonably reasonable (i.e. justifiable) when I saw them
  22. Replies
    7
    Views
    180

    Well, it fixes (somewhat) the segfault for me....

    Well, it fixes (somewhat) the segfault for me. I'm 99.9% sure the problem is in that function in any case. Other parts of the code probably need to be modified to accommodate. Maybe get ride of the...
  23. Thread: Quick speed test

    by Hodor
    Replies
    8
    Views
    368

    Also, I meant to mention the other day that the...

    Also, I meant to mention the other day that the "speed" reported by your program, for each of the functions, depends on the order they are tested. If you test method0 first and then method1, the...
  24. Replies
    7
    Views
    180

    I suspect that the function size_t utfcpy(...

    I suspect that the function size_t utfcpy( char8_t *D, size_t DLEN, char8_t const *S, size_t SLEN ) is not nul terminating the string. After modifying that function to ensure the copy is nul...
  25. Thread: Quick speed test

    by Hodor
    Replies
    8
    Views
    368

    Which bug?

    Which bug?
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4