Search:

Type: Posts; User: laserlight

Page 1 of 20 1 2 3 4

Search: Search took 0.16 seconds.

  1. During the Cretaceous period, variables had to be...

    During the Cretaceous period, variables had to be declared at the start of blocks. It was forbidden to mix declarations and non-declarative code. MSVC evolved very slowly, so it is quite possible...
  2. Okay, to avoid any possible misreading of your...

    Okay, to avoid any possible misreading of your code, I compiled this with gcc 9.3.0 with the -Wall -pedantic -std=c99 flags:

    #include <stdio.h>
    #include <math.h>
    #include <stdlib.h>


    int...
  3. Are you sure you managed to compile it with your...

    Are you sure you managed to compile it with your compiler under Code Blocks? The code has compile errors, e.g., you use the variable named V_plasmazone without declaring it. Furthermore, MSVC makes...
  4. I believe awsdert has tried Check...

    I believe awsdert has tried Check
  5. Replies
    2
    Views
    146

    I would focus on these lines first: ...

    I would focus on these lines first:

    LibraryType* library = malloc(sizeof(LibraryType));
    BookCollectionType* book = malloc(sizeof(BookCollectionType));

    addBook(book, "The Hunger Games", 2012,...
  6. Replies
    10
    Views
    364

    1. How does it not work? You need to be...

    1. How does it not work? You need to be absolutely clear what your code is supposed to do and why you concluded it does not work.

    2. Trace through your code step by step. This is with reference to...
  7. Replies
    10
    Views
    364

    You can refer to my previous post: The for...

    You can refer to my previous post:

    The for loop itself should be search the array of numbers to check if the number the user entered is equal to any one of them. If it is, that's when you announce...
  8. Oh, I just realised that you have: ...

    Oh, I just realised that you have:

    ProductCollectionType* productCollection[MAX_PROD];
    This looks strange: I would expect MAX_PROD to refer to the maximum number of products, not the maximum...
  9. If we look at addProduct, it looks like it...

    If we look at addProduct, it looks like it doesn't really add a product to the production collection. Rather, it iterates over the existing product collection and sets every existing product to the...
  10. Was that a way to subtly discourage copying the...

    Was that a way to subtly discourage copying the example by introducing a syntax error? :D

    I rarely use the comma operator because as you observed I too find that "evaluating many instructions in...
  11. Replies
    1
    Views
    189

    1. If the function is not meant to return a value...

    1. If the function is not meant to return a value then declare it to have void return type.

    2. Yes.
  12. Replies
    12
    Views
    309

    Then you're just over-complicating this whole...

    Then you're just over-complicating this whole thing. No, you don't declare the array in main because there is no array in main, only a pointer. The function that main calls handles everything, and...
  13. Replies
    12
    Views
    309

    If you're talking about initialisation in the...

    If you're talking about initialisation in the strict sense of the term, then no: you must initialise at the point of declaration.

    However, it looks like you're talking about initialisation more...
  14. You can use static non-member functions in C++...

    You can use static non-member functions in C++ exactly as you do in C, except that the conventional approach in C++ is to use non-member functions defined within an unnamed namespace instead. Either...
  15. Replies
    4
    Views
    153

    Look at this line: uc=n%10; So, uc is the...

    Look at this line:

    uc=n%10;
    So, uc is the current "last digit" or current "right-most digit" or current "least significant digit" of the number. If you return uc in the body of the loop, you...
  16. Replies
    4
    Views
    153

    Notice that in your C++ code you're printing each...

    Notice that in your C++ code you're printing each digit in the loop, whereas in your C code you're only returning the last (and hence the first, lexically speaking) digit to be printed.
  17. I'd say another consideration might be: just how...

    I'd say another consideration might be: just how large are these lists of tokens in production, and how long does each token tend to be? If these lists are long enough and comparing tokens expensive...
  18. You should provide private member functions. Why...

    You should provide private member functions. Why don't you like them? They are better than friend functions because, like non-private member functions, friend functions extend the interface of the...
  19. Three options come to mind: Copy the...

    Three options come to mind:

    Copy the subsequent elements to overwrite the deleted element, reducing the recorded size by 1. This maintains the relative order, but unfortunately deletions then run...
  20. That's because enumerators are values, not types,...

    That's because enumerators are values, not types, so you'll have to provide a single (declared explicit) constructor that has a parameter of that enumeration type, then say, use a switch on the...
  21. Replies
    8
    Views
    301

    Okay, so what's stopping you from getting them? ...

    Okay, so what's stopping you from getting them?

    I mean, you can either find an existing library to do the parsing for you, or you can implement a parser yourself (especially if you have very...
  22. Replies
    8
    Views
    301

    Isn't this a matter of parsing the file according...

    Isn't this a matter of parsing the file according to the format?
  23. Replies
    10
    Views
    364

    Okay, great. One of the things you should learn...

    Okay, great. One of the things you should learn sooner or later is how to format your code to make it readable. One important aspect of this is to use indentation to denote scopes, like what is the...
  24. Replies
    10
    Views
    364

    You didn't show the array declaration. But...

    You didn't show the array declaration.

    But perhaps more importantly, have you compiled your code and tried to run it? You need to take things slowly: write some code, make sure it compiles, and if...
  25. Application Binary Interface...

    Application Binary Interface


    The Linux kernel is not sentient (or at least I hope it isn't), hence it cannot want anything. Rather, there are core developers involved in Linux kernel development...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4