Search:

Type: Posts; User: erikkonstas

Search: Search took 0.01 seconds.

  1. By the way, the two output sides might be...

    By the way, the two output sides might be different, but they will always be the same every time the program is ran if you don't use srand. For example, in my case, your original code output Tails...
  2. Replies
    9
    Views
    243

    Um I didn't say anything different than john.c...?

    Um I didn't say anything different than john.c...?
  3. Replies
    9
    Views
    243

    Yes, in fact, global variables are stored in a...

    Yes, in fact, global variables are stored in a separate part of memory on their own. Note that a global variable isn't the only kind of "a variable that will not get destroyed", but it's the only...
  4. Replies
    9
    Views
    243

    Nope. You have to declare it with extern in every...

    Nope. You have to declare it with extern in every compiled file (after preprocessing, so if you just declare it in a header you include in every file, you're OK).
  5. Replies
    5
    Views
    422

    I can, too!

    I can, too!
  6. Replies
    6
    Views
    360

    Nope, everything should be an int here,...

    Nope, everything should be an int here, especially since % is used.
  7. Replies
    8
    Views
    343

    Hm, I wanted to emphasize laserlight's point...

    Hm, I wanted to emphasize laserlight's point above; you do not want to compute the file size beforehand! Who knows what your function will accept as its argument? What if it receives STDIN, for...
  8. Hm, can you mention why you'd want to do this?...

    Hm, can you mention why you'd want to do this? The text "width" you're talking about depends completely on the font the text is written in; for example, on a terminal, the font will most likely be...
  9. Depending on how the "array" is declared, it can...

    Depending on how the "array" is declared, it can also mean that what you pass to sizeof might be a pointer so it returns that size, not the array's! We really need to see more code to be sure what's...
  10. Can you clarify this, please? I can't understand...

    Can you clarify this, please? I can't understand exactly what you want to do.
  11. Replies
    7
    Views
    572

    Hi, can you show what you've done so far? We...

    Hi, can you show what you've done so far? We don't generally do other peoples' homework entirely.
  12. Replies
    6
    Views
    641

    Yep, that's exactly my point about Sedgewick. So...

    Yep, that's exactly my point about Sedgewick. So I checked again, we're actually using the THIRD edition at university, and the thing where the text and the code differ a lot semantically is very...
  13. Replies
    6
    Views
    735

    On top of that, it appears that you've copied...

    On top of that, it appears that you've copied your code incorrectly here, because I can see a missing ) on line 29.
  14. Replies
    6
    Views
    641

    Yeah... I happen to be experiencing Sedgewick's...

    Yeah... I happen to be experiencing Sedgewick's snippets from this very book (second edition, current university professor is using it) and his coding style is HORRENDOUS!!! Globals everywhere (in...
  15. 1. argv is actually an array of pointers to char...

    1. argv is actually an array of pointers to char (char *), the first of which is at the memory address in the argv variable itself, which is why you're "requesting another pointer". Each of these...
  16. I want to point out that setting i to values...

    I want to point out that setting i to values above 0 does actually do something bad in your case: if your string's length is less than the initial value of i, you will be accessing memory you...
  17. Hm, bummer. I was trying to write some test...

    Hm, bummer. I was trying to write some test project which has a lot of functions and decided to split them in a few .c files but I guess I'll have to do either of these two. Thanks for answering,...
  18. "External" linkage between some files but "internal" linkage to the outside world

    Let's say I have a file f1.c with the following:
    int two(int a, int b) {
    return a + b;
    }And a file f1.h with the following:
    int two(int, int);And a file f2.c with the following:
    #include...
Results 1 to 18 of 18