Search:

Type: Posts; User: Alexpo

Search: Search took 0.00 seconds.

  1. Replies
    1
    Views
    2,129

    what can not be tested in C++ unit testing?

    Hi,

    Hi I am sorry if its not the right place to put the question.(I'll request modeartor to put it to right place, but i think we dont have a subforum to testing c++ program).

    Coming to my...
  2. Replies
    16
    Views
    24,713

    data abstarction is there in C and highly used.

    So finally, the answer to the question "Can we have data abstraction in C?" is YES.

    The data type like Stack, Queue...etc are perfect examples of data abstraction and those all are well...
  3. exactly....obj and obj2 are pointers not instances of MyString

    Thanks Anon,

    exactly....obj and obj2 are pointers not instances of MyString.
    how stupid sometime a person can get. :mad:
  4. folllowing code should call the copy constructor and shud not give run time error!

    #include "stdafx.h"
    #include <iostream>
    using namespace std;

    class MyString
    {
    public:

    MyString(const char *str="")
    {
  5. Replies
    2
    Views
    833

    is thispointer is a part of an object

    hi,

    can we say "this" pointer is a part of the object in question or it is something created by compiler outside the object to store address of the object?
    i think it is not the part of it....
  6. Yes, the code compiles, but doesn't...

    Yes, the code compiles, but doesn't execute.Throws exception.
  7. Thanks Elysia, Especially the extra thing, you...

    Thanks Elysia,

    Especially the extra thing, you made me know that " _" is used for language implementation.

    And would you pls, let me know where can i find more precise technical info about "how...
  8. is it fine to assign zero(0) to a string object, in any case?

    I have seen wide use of the following type of

    String _name;
    _name = 0; in the book inside c++ object model (By Lippman).

    though my compiler VC++ 8 does not allow the code to compile
    and it...
  9. Replies
    2
    Views
    1,383

    virtual inhertance *intersting*

    #include "stdafx.h"
    #include <iostream>
    using namespace std;


    class sample
    {
    int i;
    virtual void fun(){};
    };
  10. Replies
    1
    Views
    1,079

    when constructor leave will memory will leak?

    Here is the code


    class Someclass
    {
    private:
    SomeOtherclass* p;
    public:
    Someclass()
    {
  11. Hi Elysia, Got the point.Thanks. Hi Mats, ...

    Hi Elysia,

    Got the point.Thanks.

    Hi Mats,



    Thanks for this info. beacuse I was confused it to be data or code section.As somewhere I read it as code section and some where as data section.
  12. Hi San_Crazy & all, . Its true that we...

    Hi San_Crazy & all,

    .

    Its true that we don't know the size of memory pointed by "pa" but the folloing code is also woking fine


    void fun(char *pa)
    {
    pa="Mystring";
  13. Thanks QuantumPete, Would you please name the...

    Thanks QuantumPete,

    Would you please name the special area of memory(if it having).Its an area in memory (from code segment or from data segment ) where all constant data are stored, right? ...
  14. passing a pointer to string giving segmentaion fault

    #include "stdio.h"

    void fun(char *pa)
    {
    strcpy(pa,"MyString");

    }

    int main()
    {
  15. Replies
    1
    Views
    1,334

    difference in the content of Dll and Lib

    Hi,

    There are some questions regarding dll and library .

    I know,static library files are linked statically by linker at start up.On the other hand dll was used to link the required...
  16. Replies
    4
    Views
    1,370

    What is the need of nested Class?

    Hi All,

    We can not access the data member of a class nested with in another class.It does not get instantiated also.So what are the use of having a class nested with in another class?

    Thanks...
  17. Replies
    2
    Views
    1,134

    Leaving constructor

    Here is a class


    class MyClass{

    private:
    SomeClass* sc;
    public:

    MyClass()
  18. Replies
    1
    Views
    5,741

    (array+ 1 ) and (&array+1) diff ?

    Hi,

    name of array gives us the base address always.
    so, in the code below:



    int arr[]={1,2,3};
    printf("&#37;p:%p", arr+1,&arr+1);
  19. Replies
    5
    Views
    2,762

    You are right dwks..its compling with out error...

    You are right dwks..its compling with out error with .c extension.
    I got the point from yours and Elysia's reply.

    Thanks to u both,
    A
  20. Replies
    5
    Views
    2,762

    type casting void *

    Does following code compile in any compiler ?


    ...
    int * p,*q;
    void *vp;

    int a=5;
    p=&a;
    vp=p; // I know this perfectly ok
  21. Thanks Elysia and Mats. Its realy a weired...

    Thanks Elysia and Mats.

    Its realy a weired expression and only ok in books teaching different (and complex)way of doing things and should be avoided in reallife coding.

    Regards,
    --A
  22. What does this declaration mean..*ptr="SomeChars"[var1%var2] ?

    Hi,

    I came across such an expresiion from a C book..whose explanation was not there.

    *ptr="SomeChars"[var1&#37;var2] ?

    Here ptr is pointer to char and var1 and var2 are two int varible.

    I am...
  23. Thanks for ur reply. Will you please tell me...

    Thanks for ur reply.

    Will you please tell me how to acess that data members.
    I was using those kinds of name just to convey the idea.

    The real life problem may be like this:

    I have a...
  24. Acessing the data from one object from another object

    Hi ,

    I am a beginner in C++.

    I want to know how can we access data member of a class from another class. I am facing problem in visualizing the things in writing separate .h and .cpp file.
    ...
Results 1 to 24 of 24