Search:

Type: Posts; User: maven

Page 1 of 6 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    3
    Views
    1,075

    Ok. Understood. Thanks a lot guys for clearing...

    Ok. Understood. Thanks a lot guys for clearing out my confusion.
  2. Replies
    3
    Views
    1,075

    Need Some explanation for this program output

    Hi,

    I am returning to C programs after a long time and i have confusion why 3rd output is 31! Remembering concepts of precedence and association i think i am either overlooking something or it may...
  3. Replies
    5
    Views
    858

    ok. I tried it like this. Used below structure...

    ok.

    I tried it like this. Used below structure and struct "forShm" to insert in shared memory. I am able to copy data and do all. But while reading seems it is getting some garbage. I believe i...
  4. Replies
    5
    Views
    858

    Shared memory program

    Hi,

    I have one requirement to store an array of structure at shared memory. Also the shared memory should have one counter to store number of elements in the array.

    I tried to look at some...
  5. Thread: Copy constructor

    by maven
    Replies
    25
    Views
    1,480

    Hence it means, code will perform perfect deep...

    Hence it means, code will perform perfect deep copy.


    dataPtr = d.dataPtr;
  6. Thread: Copy constructor

    by maven
    Replies
    25
    Views
    1,480

    i meant actually Following are the deep copies,...

    i meant actually
    Following are the deep copies,


    a = b;
    *y = *x;

    For the rest, One has the error and one is shallow copy.
  7. Thread: Copy constructor

    by maven
    Replies
    25
    Views
    1,480

    deep copies are, one has error and one is...

    deep copies are, one has error and one is shallow copy!


    a=b;
    *x=*y;
  8. Thread: Copy constructor

    by maven
    Replies
    25
    Views
    1,480

    Error will be at: b=x; int=int*;

    Error will be at:


    b=x;
    int=int*;
  9. Thread: Copy constructor

    by maven
    Replies
    25
    Views
    1,480

    In a deep copy instead of sharing same address...

    In a deep copy instead of sharing same address space we use different address space for variables(pointer).
    And you mean "dataPtr = d.dataPtr;" is doing deep copy!
  10. Thread: Copy constructor

    by maven
    Replies
    25
    Views
    1,480

    Considering example i used. If i copy pointer...

    Considering example i used. If i copy pointer like this then it is a shallow copy. whereas i asked how to do deep copy here.


    exportData::exportData(const exportData& d):a(d.a),c(d.c){
    strcpy(b,...
  11. Thread: Copy constructor

    by maven
    Replies
    25
    Views
    1,480

    What is the context of these x and y. Are you...

    What is the context of these x and y. Are you considering these structure member variables? I am not able to relate my question with your answer!!
  12. Thread: Copy constructor

    by maven
    Replies
    25
    Views
    1,480

    syntax i am aware of: ...

    syntax i am aware of:


    exportData::exportData(const exportData& d):a(d.a),c(d.c){
    strcpy(b, d.b);
    dataPtr = new dataPtr();
    //After this how to make everything copy again in dataPtr, i was...
  13. Thread: Copy constructor

    by maven
    Replies
    25
    Views
    1,480

    pointer is the base requirement, I can not change...

    pointer is the base requirement, I can not change this. And that is why i am looking the ways to write copy constructor for this.
  14. Thread: Copy constructor

    by maven
    Replies
    25
    Views
    1,480

    Copy constructor

    Hi Guys,

    I have a structure and for this i want to create a copy constructor.



    struct my_Export exportData
    {
    int a;
    char b[10];
  15. Replies
    3
    Views
    1,446

    Vector.clear is creating problem

    Hi,

    I was looking at an old multithreaded program which is creating problem (core dump)!. The debugger tells the problem at vector.clear().



    =>[1] __rwstd::__destroy<UCProfileData>(pointer =...
  16. Only saying "not working" does not make any sense...

    Only saying "not working" does not make any sense to us.
    What is the error you are getting with these two.. Whether it is a compilation error or run time error?? What is the error returned? Please...
  17. Replies
    14
    Views
    1,251

    I would like to add here, If you have insert new...

    I would like to add here, If you have insert new items in the map then prefer insert() method over index overloaded operator insertion mechanism. insert() is more efficient in this case. And when you...
  18. Replies
    14
    Views
    4,987

    U have explained exact solution of the problem...

    U have explained exact solution of the problem well, but still change of compiler is required, because of the code which is pasted has redeclaration of 'my_p_units_ptr' and 'p_price' and still user...
  19. Replies
    14
    Views
    4,987

    Are you able to compile this program, With having...

    Are you able to compile this program, With having redeclaration of 'my_p_units_ptr' and 'p_price'! Seems some serious issues with your compiler. Change the compiler first.
  20. When you are in main(), p is a pointer which is...

    When you are in main(), p is a pointer which is always pointing to the first(head) node. If you call free() for only p then only first node will be deallocated and not rest. It leads to memory leak....
  21. Replies
    7
    Views
    17,412

    fineLowest.. Lowest is fine instead of find :)

    fineLowest.. Lowest is fine instead of find :)
  22. Replies
    23
    Views
    2,756

    Have you searched for this file in your system!...

    Have you searched for this file in your system! Have you googled it!
    Even though not solved, look something simillar to your problem:...
  23. Replies
    19
    Views
    1,891

    The signature of strtok and c_str() is: char...

    The signature of strtok and c_str() is:


    char *strtok(char *s1, const char *s2);
    const char* c_str ( ) const;


    C++ Standard does not suggest the casting as u did for first argument.
  24. Replies
    5
    Views
    1,397

    Do u know the purpose of using curly braces? ...

    Do u know the purpose of using curly braces?


    {
    }
  25. Replies
    9
    Views
    1,668

    My context was for implicit default constructors....

    My context was for implicit default constructors.
    I said "Default constructor does not INITIALIZE primitive types (POD)". This states true except when object is in static or global scope....
Results 1 to 25 of 139
Page 1 of 6 1 2 3 4