Search:

Type: Posts; User: laserlight

Page 1 of 20 1 2 3 4

Search: Search took 0.13 seconds; generated 1 minute(s) ago.

  1. Replies
    1
    Views
    47

    Draw on paper a singly linked list with say, 4...

    Draw on paper a singly linked list with say, 4 nodes. Pick a node and think about how you might go about doing it. Pick another node, say the first and last and go through how you would delete it....
  2. If you want to use st, why are you still...

    If you want to use st, why are you still declaring and using p1?
  3. Err... N is just a member of the struct. It...

    Err... N is just a member of the struct. It doesn't tell you how much memory has been allocated. Furthermore, you printed its value before assigning it an initial value, so you got garbage.
  4. Actually, we always dynamically allocate memory...

    Actually, we always dynamically allocate memory for objects, where an object is some region of memory storing a value of some type. So, an object could be of pointer type, of some struct type, of...
  5. Why do you want to dynamically allocate memory?

    Why do you want to dynamically allocate memory?
  6. Replies
    4
    Views
    193

    Oh dear, my apologies, my turn to not see that...

    Oh dear, my apologies, my turn to not see that this was posted in the C programming forum. The C++11 rules are likely to be consistent with C99 though as that's the C++11 reference for constructs...
  7. Replies
    4
    Views
    193

    Both of these are directly addressed by the C++...

    Both of these are directly addressed by the C++ standard:

    So, 2 >> -1 results in undefined behaviour, 2 >> 5 results in zero, and -2 >> 1 has an implementation-defined result.


    Both of these...
  8. Replies
    7
    Views
    188

    Yes, except that your problem has to do with you...

    Yes, except that your problem has to do with you mixing up a function declaration versus a function call.


    Thankfully, multiple errors are sometimes due to the same mistake. Take these four...
  9. Replies
    2
    Views
    136

    Your first struct declaration is not...

    Your first struct declaration is not syntactically correct in the first place. Perhaps what you wanted to do was this:

    struct student {
    char name[30];
    int rollNo;
    struct dateOfBirth...
  10. Since you're using such a recent IDE with a...

    Since you're using such a recent IDE with a compiler that supports C++17, have you considered using the standard filesystem library instead?
  11. Replies
    9
    Views
    133

    The second is probably better: you can just take...

    The second is probably better: you can just take the address of the local variable at the end. No need to worry about unique_ptr and even think about memory management.
  12. Replies
    9
    Views
    133

    Yes, but then you won't meet your "create struct...

    Yes, but then you won't meet your "create struct instance on heap" requirement.
  13. That is with respect to the specific claim that...

    That is with respect to the specific claim that "It's easy to represent 100 lines of (...) Python, (...) code in just 1 line of Rapid Euphoria". According to the example that you gave, it isn't. For...
  14. Replies
    14
    Views
    210

    You could say that, but it would be more accurate...

    You could say that, but it would be more accurate to say that you allocated memory for what i points to.


    Just remember that since i is a pointer to int, *i is an int, so you assign to the int...
  15. Replies
    9
    Views
    133

    No. If I were you, I would start with something...

    No. If I were you, I would start with something simpler, e.g.,

    #include <memory>
    #include <string>
    #include <cstring>
    #include <iostream>

    struct TestParms
    {
    char parm1[48];
  16. I'm afraid that I'm not familiar with QBASIC,...

    I'm afraid that I'm not familiar with QBASIC, which is why I asked for a Python example since you mentioned Python specifically.


    The same can be done in Python though: a single list of items of...
  17. Replies
    9
    Views
    133

    Your first mistake is not posting the smallest...

    Your first mistake is not posting the smallest and simplest program that you expect should compile, but which results in a particular compile error. Your second mistake is not posting the compile...
  18. Replies
    9
    Views
    133

    * moved to C++ programming forum *

    * moved to C++ programming forum *
  19. Could you show an example of a 100 line Python...

    Could you show an example of a 100 line Python program that can be written with a single line of Rapid Euphoria code?
  20. Replies
    3
    Views
    128

    There is no such built-in type named BIGINT....

    There is no such built-in type named BIGINT. Refer to flp1969's post #2 for a library that can help.
  21. Replies
    3
    Views
    128

    Extern global: use them when you need global...

    Extern global: use them when you need global state that is really meant to be accessed directly throughout your program. An example of this that you have encountered would be stdin and stdout......
  22. Replies
    3
    Views
    128

    Both have static storage duration, and typically...

    Both have static storage duration, and typically what makes a static local useful (that it persists between function calls and you can return a pointer to it despite it being local) also means it...
  23. To be fair, that is what shian is hoping to...

    To be fair, that is what shian is hoping to overcome with this request for a volunteer, after all. Are you volunteering? :D
  24. Replies
    14
    Views
    365

    Great, so what is your current code and how does...

    Great, so what is your current code and how does it not work?
  25. This is a rare case of hearing someone indulge in...

    This is a rare case of hearing someone indulge in premature optimisation for compile time, even more strangely when the compiler might be able to optimise for runtime. I'd say that this should be...
Results 1 to 25 of 498
Page 1 of 20 1 2 3 4