Search:

Type: Posts; User: laserlight

Page 1 of 20 1 2 3 4

Search: Search took 0.11 seconds.

  1. Replies
    30
    Views
    241

    The reasoning still applies: if you don't enable...

    The reasoning still applies: if you don't enable optimisations when optimising, whatever measurements you do to determine bottlenecks etc will be inaccurate after you enable optimisations for...
  2. Replies
    30
    Views
    241

    Where optimisation is concerned, that doesn't...

    Where optimisation is concerned, that doesn't make sense: you should compile at the highest optimisation level that you're comfortable with so you can find where code needs to be optimised. If you...
  3. When you need to retain both an original ordering...

    When you need to retain both an original ordering and a sorted ordering (or even multiple sorted orderings according to different comparison criteria), one approach is to sort a container of pointers...
  4. Replies
    9
    Views
    139

    Yes, a string will be converted to a pointer to...

    Yes, a string will be converted to a pointer to its first char, so you shouldn't be taking its address with the address-of operator.

    However, you should also be aware that using a %s without...
  5. Replies
    30
    Views
    241

    Have you considered the syntactic sugar of array...

    Have you considered the syntactic sugar of array notation:

    notice->ownerId = ((int*)(glance->idNodes.space.block))[glance->process];


    I think you'll find that any optimising compiler will be...
  6. Replies
    30
    Views
    241

    It would... if you're declaring the variable in...

    It would... if you're declaring the variable in the condition. awsdert declared the variables before that point, so no, it doesn't.
  7. Replies
    30
    Views
    241

    readdir is not part of standard C, but it is...

    readdir is not part of standard C, but it is POSIX standard, so if you don't know how readdir works, it's pretty easy to find out because POSIX stuff tends to be online via web-based manual pages and...
  8. Replies
    30
    Views
    241

    You might want to say what's wrong with awsdert's...

    You might want to say what's wrong with awsdert's code such that taking a look at that webpage makes sense. I note that awsdert's code does suppress a common compiler warning associated with using...
  9. Replies
    30
    Views
    241

    Yes, because at some point readdir will return a...

    Yes, because at some point readdir will return a null pointer.
  10. Replies
    9
    Views
    124

    It's wrong by definition: the return type of main...

    It's wrong by definition: the return type of main is int.


    The format specifier you used is %d, which expects a corresponding int argument. You passed 59.00 as the corresponding argument, which...
  11. Replies
    9
    Views
    139

    That's because they wanted to allow declaring of...

    That's because they wanted to allow declaring of variables of the struct type in a compact form... which ironically is generally seen as a poor practice these days because such variables would almost...
  12. The issue you have is that when an array is...

    The issue you have is that when an array is passed as an argument, it is converted to a pointer to its first element. This means that an array of arrays is converted to a pointer to an array, not a...
  13. Replies
    9
    Views
    139

    You mentioned string input, but it looks like you...

    You mentioned string input, but it looks like you intended integer input.
  14. Which you did not explain, neither in your post...

    Which you did not explain, neither in your post nor in a comment. You only mentioned being unable to "get even one result out of it", but leave the reader to figure it out from scratch. So...
  15. Replies
    2
    Views
    92

    Shouldn't you likewise be fascinated into...

    Shouldn't you likewise be fascinated into thinking how "just a simple ASCII value" can produce a little graphic on screen that we can identify as text, "since ASCII only has 7 -bit"?

    The answer is...
  16. Read your first post in this topic again. No, you...

    Read your first post in this topic again. No, you didn't state that, and even if you had, that's still a pretty sparse description: you should connect it to the code so that there's context that's...
  17. When starting a new post, you should introduce...

    When starting a new post, you should introduce what you're doing: what is the problem that you're trying to solve? What is the test input, expected output, and actual output? If you cannot provide...
  18. Replies
    27
    Views
    328

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

    No, your learning material should have a section on data types that explains this.
  19. Replies
    27
    Views
    328

    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...
  20. Replies
    27
    Views
    328

    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?
  21. Replies
    27
    Views
    328

    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...
  22. Replies
    27
    Views
    328

    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...
  23. Replies
    2
    Views
    203

    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?
  24. Replies
    9
    Views
    150

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

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

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