Search:

Type: Posts; User: laserlight

Page 1 of 20 1 2 3 4

Search: Search took 0.17 seconds.

  1. Replies
    20
    Views
    118

    No, your learning material should have a section...

    No, your learning material should have a section on data types that explains this.
  2. Replies
    20
    Views
    118

    Then pause your assignments. Go back to your...

    Then pause your assignments. Go back to your earlier learning material and figure out how to write a "hello world" program in C++. Do that first, then figure out how to write a C++ program that can...
  3. Replies
    20
    Views
    118

    If you don't know what is it for, why are you...

    If you don't know what is it for, why are you trying to install it?
  4. Replies
    20
    Views
    118

    Yes. That's something you have to sort out...

    Yes.


    That's something you have to sort out with the professor or other members of the teaching team. The forum members here cannot help you with the specifics beyond "write your code in an...
  5. Replies
    20
    Views
    118

    That's a pretty common approach though: figure...

    That's a pretty common approach though: figure out a mathematical formula, then write a program to implement and hence automate it. If that's not the way your professor intends, then what is...
  6. Replies
    2
    Views
    111

    Are you aware that this is a forum for the C...

    Are you aware that this is a forum for the C programming language, whereas the code that you posted is not written in the C programming language?
  7. Replies
    9
    Views
    127

    The second argument to creat is the mode, not...

    The second argument to creat is the mode, not file creation flags.
  8. Replies
    2
    Views
    83

    You could store generic regions of memory instead...

    You could store generic regions of memory instead (i.e., objects, except for the lack of type information beyond the size), by recording the size of one object of the given type. This way, you still...
  9. Replies
    4
    Views
    102

    Of course. Whose code is it? Probably...

    Of course. Whose code is it?


    Probably because it must outlive the scope of the function. I'm not familiar with this API, but in modern C++ we are unlikely to do things this way: we would be...
  10. Replies
    4
    Views
    102

    I would expect it to be used when dynamic memory...

    I would expect it to be used when dynamic memory is required or at least convenient, or when stack memory is expected to be insufficient. So examine the code and see whether these apply.

    By the...
  11. Replies
    30
    Views
    347

    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....
  12. 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...
  13. 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...
  14. Replies
    3
    Views
    142

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

    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...
  16. Replies
    7
    Views
    137

    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...
  17. Replies
    7
    Views
    137

    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...
  18. Replies
    7
    Views
    137

    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'.
  19. 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...
  20. 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...
  21. Post your code in forum bbcode tags, not quote...

    Post your code in
    forum bbcode tags, not quote tags.
  22. Replies
    7
    Views
    137

    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...
  23. 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);
  24. Replies
    8
    Views
    234

    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.
  25. 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.
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4