We can do in C but not in C++

Discussion in 'C++' started by arangasoft, Jan 3, 2005.

  1. arangasoft

    arangasoft New Member

    Joined:
    Sep 13, 2004
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Student
    Location:
    Trichy, Tamizh nadu
    Hai,

    Any body can tell me the answer for this question.The question is " We can do in C program but not in C++ program.what is that?".It was in my software test paper.I couldn't able to answer that question.So please help me...
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    Hello,

    Can you reduce the size of your signature. It looks annoying.

    Also regarding your query. Something you cannot do in C++ but in C

    void *ptr1;
    long *ptr2 = ptr1;

    Also you can try compiling this in C it will but not in C++
    Code:
     int main()
     {
        int class = 0;
        int template = 4;
        class += template;
     }
     
    Also have this link as in interview you have been asked probably this question.
    http://www.onesmartclick.com/interviews/interviews-programming.html

    Thanks
    Shabbir Bhimani
     
    Last edited: Jan 4, 2005
  3. elec.shabnam

    elec.shabnam New Member

    Joined:
    Feb 13, 2008
    Messages:
    102
    Likes Received:
    0
    Trophy Points:
    0
    i m really weak with pointers can you suggest some good books
     
  4. rlearntowin1

    rlearntowin1 New Member

    Joined:
    Feb 26, 2008
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    0
  5. soorajlal

    soorajlal New Member

    Joined:
    Oct 21, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    hai,


    in cpp we can usr reference variables..but in c not...
    search on reference variable for more.....
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice