Search:

Type: Posts; User: laserlight

Page 1 of 20 1 2 3 4

Search: Search took 0.14 seconds.

  1. * moved to C++ programming forum *

    * moved to C++ programming forum *
  2. Replies
    4
    Views
    106

    Explain why you have such a doubt.

    Explain why you have such a doubt.
  3. Replies
    4
    Views
    106

    Just print the pointer whose value was returned...

    Just print the pointer whose value was returned by malloc:

    printf(" address : %p \n", (void*)st);
  4. You're basically creating an object merely to...

    You're basically creating an object merely to serve as documentation, and it really is just documentation as you could have just as easily written by mistake:

    Character Knight("Knight",...
  5. Replies
    2
    Views
    93

    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....
  6. If you want to use st, why are you still...

    If you want to use st, why are you still declaring and using p1?
  7. 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.
  8. 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...
  9. Why do you want to dynamically allocate memory?

    Why do you want to dynamically allocate memory?
  10. Replies
    4
    Views
    202

    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...
  11. Replies
    4
    Views
    202

    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...
  12. Replies
    7
    Views
    198

    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...
  13. Replies
    2
    Views
    145

    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...
  14. 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?
  15. Replies
    9
    Views
    139

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

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

    Yes, but then you won't meet your "create struct instance on heap" requirement.
  17. 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...
  18. Replies
    14
    Views
    220

    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...
  19. Replies
    9
    Views
    139

    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];
  20. 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...
  21. Replies
    9
    Views
    139

    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...
  22. Replies
    9
    Views
    139

    * moved to C++ programming forum *

    * moved to C++ programming forum *
  23. 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?
  24. Replies
    3
    Views
    130

    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.
  25. Replies
    3
    Views
    131

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