Search:

Type: Posts; User: laserlight

Page 1 of 20 1 2 3 4

Search: Search took 0.14 seconds.

  1. You might want to consider parsing...

    You might want to consider parsing /proc/<PID>/stat instead as it is supposed to be more machine-readable (with say, scanf or sscanf) whereas /proc/<PID>/status is supposed to be more human-readable....
  2. It might be helpful to avoid global variables:...

    It might be helpful to avoid global variables: only declare variables within functions. Then you find out how you can provide addnumbers with two int parameters such that the main function can call...
  3. The warning is because you didn't declare the...

    The warning is because you didn't declare the function addnumbers before calling it in the main function. What you need to do is to either forward declare the function (i.e., declare it before main...
  4. It seems to me that the man page you consulted...

    It seems to me that the man page you consulted has answered your question.


    Which other sources are these?

    EDIT:
    My bad. Something sounded wrong to me, and I decided to check my own system's...
  5. Replies
    8
    Views
    210

    The problem is that you're using the %c format...

    The problem is that you're using the %c format specifier to print a non-printable character in this context. Try: c=0x4B or c=0x7A


    So you know that it is correct. You don't have to worry about...
  6. Replies
    7
    Views
    117

    It is legal (as you can see from your test with a...

    It is legal (as you can see from your test with a compiler), but that means in your post #3 you correctly worked out the ramifications of the conversion of string constant to pointer (to char) on...
  7. Replies
    7
    Views
    117

    I meant exactly that: compare...

    I meant exactly that: compare serie_list[i]->serieName with "" instead of "\0", because the intent is likely to check if serie_list[i]->serieName is an empty string, whereas "\0" is not semantically...
  8. Replies
    7
    Views
    117

    Yes, but it means either using strcmp or directly...

    Yes, but it means either using strcmp or directly comparing for the empty string by testing if the first character is '\0'.
  9. That's good, but you should also indent your code...

    That's good, but you should also indent your code properly. This way, it becomes easier to trace through what's happening in your code, which is precisely what you need to do in order to figure out...
  10. That's feedback with very low value. It is only...

    That's feedback with very low value. It is only useful if there was an obvious error in that example, if not, as stahta01 implied, it probably means that you made a mistake, but no one else knows...
  11. Post your code in forum bbcode tags, not quote...

    Post your code in
    forum bbcode tags, not quote tags.
  12. Replies
    7
    Views
    117

    What's the problem, i.e., how does it not work? ...

    What's the problem, i.e., how does it not work?


    For the special case of zero, it might be more convenient to use calloc instead of malloc then.

    By the way, this likely to be a bug:

    for (i...
  13. You forgot the closing double quote for the...

    You forgot the closing double quote for the string constant on this line:

    printf("The youngest, %s, is %d.\n, childname, age);
  14. Replies
    8
    Views
    210

    It seems to me that '0xAA' is a multi-character...

    It seems to me that '0xAA' is a multi-character constant formed from the characters '0', 'x', 'A', and 'A', whereas '\xAA' is a character constant having a value of 0xAA.
  15. The function is declared in fe-auth.h, so I don't...

    The function is declared in fe-auth.h, so I don't see what's the problem: just include that header and link appropriately.
  16. Replies
    5
    Views
    176

    No, you don't. addNode returns a pointer to head,...

    No, you don't. addNode returns a pointer to head, so you just need to use it:

    list = addNode(list, 1);
  17. A string is already an array: an array of...

    A string is already an array: an array of characters whose elements in use are at index 0 up to the index of the first null character.
  18. Replies
    5
    Views
    176

    The programming language that that code was...

    The programming language that that code was written in was unstated. It certainly looks like C, and with the right declarations it will probably be compilable as C, but I suggest treating it as...
  19. The problem is that in increase_nodes_capacity,...

    The problem is that in increase_nodes_capacity, nodes is a pointer to Node. It should be a pointer to a pointer to Node so that you can change it from within the function.
  20. Replies
    5
    Views
    243

    As in you cannot change your function signature...

    As in you cannot change your function signature and return type? If so, then indeed you must malloc to allocate space for the pointers, but as I said you need to allocate 1000 * sizeof(*sreees). You...
  21. Replies
    5
    Views
    243

    This is almost certainly wrong: serie** ...

    This is almost certainly wrong:

    serie** sreees = (serie**)malloc(1000);
    You want to malloc some multiple of sizeof(*sreees). Actually, because your instructions state that "The size of the array...
  22. Replies
    72
    Views
    846

    No, except that it does require a PRNG and...

    No, except that it does require a PRNG and imposes some minimum requirements on the PRNG like a minimum RAND_MAX.
  23. Replies
    72
    Views
    846

    No, that's not necessarily the point: while "true...

    No, that's not necessarily the point: while "true randomness" typically cannot have sequences reproduced on demand other than by saving the sequences to replay them, there's statistical randomness...
  24. Replies
    4
    Views
    292

    From what I see, the C standard does not include...

    From what I see, the C standard does not include min and max in <math.h>, hence there has been no version of the C++ standard that included std::min and std::max in <cmath>. Hence, it is likely that...
  25. Replies
    6
    Views
    163

    That sounds like either you didn't generate the...

    That sounds like either you didn't generate the static library file correctly, or you didn't link to it correctly. What exactly were the steps you took?
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4