Search:

Type: Posts; User: Shafiul

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    1
    Views
    598

    Why is the while loop still executing?

    #include<stdio.h>
    int main()
    {
    unsigned int rowIndex = 0;
    int nRow = -1;
    while (rowIndex < nRow)
    {
    printf("%d\n", rowIndex);
    rowIndex++;
    }
  2. Guys, I am sorry to be late to deliver THANKS to...

    Guys, I am sorry to be late to deliver THANKS to everyone. Appreciated so much that I have learned from your code. Thanks again.
  3. The problem of the following formula(value = 2.0...

    The problem of the following formula(value = 2.0 * (rnumber - 0.5)), it provides sometimes -1 or +1 once the rnumber is 0 or 1.



    #include<stdio.h>
    #include<iostream>
    int main()
    {
    float...
  4. How to generate a random number in the interval of -1 and 1?

    If R is a random number, R has to be in the interval of -1 and 1, i.e, -1<R<1. Any idea?
  5. Is there any specific method to turn an array value from positive to negative?

    Hi everyone,
    Is there any specific technique to turn all of the array values from positive to negative?
  6. Thanks Salem and John too for comments.

    Thanks Salem and John too for comments.
  7. Thanks.

    Thanks.
  8. Thanks Amanda for your comments.

    Thanks Amanda for your comments.
  9. Is it necessary to free an allocated variable inside a local function?.

    Do I need to free variable 'var' inside of local function func()?.



    #include<stdio.h>
    #include<stdlib.h>
    void func()
    {
    int* var = (int*)malloc(sizeof(*var));
    }
  10. Alright.

    Alright.
  11. Thank you very much for your answer. Appreciated....

    Thank you very much for your answer. Appreciated. However, wondering part is, why is the if(arr) expression returning a true value!. It should not return a true value after executing free(ptr). Sorry...
  12. Why does the statement if(arr) free(arr); still executing?

    Hello everyone, I have a heap allocated array arr. The allocation in arr is freed by using a pointer ptr. Therefore, if(arr) statement should return a false value. But practically it returns a true...
  13. Replies
    12
    Views
    1,402

    Thanks Hamster_nz. Thanks Jona.

    Thanks Hamster_nz. Thanks Jona.
  14. Replies
    12
    Views
    1,402

    Is there any way to free up the entire allocated...

    Is there any way to free up the entire allocated space which was allocated inside a function of create_numbers?
  15. Replies
    12
    Views
    1,402

    Thanks once again for your help. I am just afraid...

    Thanks once again for your help. I am just afraid to ask, does free(numbers) actually free the first element of result array or all the elements?
  16. Replies
    12
    Views
    1,402

    Meanwhile I am also sorry for my poor coding...

    Meanwhile I am also sorry for my poor coding style. I will try to improve in near future.
  17. Replies
    12
    Views
    1,402

    Super useful. Thanks Amanda.

    Super useful. Thanks Amanda.
  18. Replies
    12
    Views
    1,402

    Hi Amanda, Nice to see your feed back. I wrote a...

    Hi Amanda, Nice to see your feed back. I wrote a sample program for one test case. However, for some reason, I can not declare the array or allocate a pointer with a specific size in the main...
  19. Replies
    12
    Views
    1,402

    A weird question

    Is there any way to declare an array inside main function but initialization of this array will be into another function (out of main function)?. If possible, after initialization, is there any...
  20. Replies
    4
    Views
    1,603

    Thanks Amanda for a nice explanation. Now It is...

    Thanks Amanda for a nice explanation. Now It is clear to me. Thanks again.
  21. Replies
    4
    Views
    1,603

    Hi Malcolm, thanks for the answer. If I want to...

    Hi Malcolm, thanks for the answer. If I want to share the updated value of object owned by main to the object owned by class A, what should I do?
  22. Replies
    4
    Views
    1,603

    Request for help

    #include <iostream>
    using namespace std;

    class B
    {
    public:
    int value;
    B(){
    value = 10;
    }
  23. Thanks Laserlight.

    Thanks Laserlight.
  24. Thanks Rstanley.

    Thanks Rstanley.
  25. Why does this little code consume extra bytes of memory?

    In the following program, the structure object nd[0] node consumed 8 bytes of memory. Ideally, nd[0] should consume 5 bytes of memory in total. I mean, 4 bytes for Int type + 1 byte for the char...
Results 1 to 25 of 43
Page 1 of 2 1 2