We can do in C but not in C++

arangasoft's Avatar
Light Poster

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...
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder

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++
 int main()
    int class = 0;
    int template = 4;
    class += template;
Also have this link as in interview you have been asked probably this question.

Shabbir Bhimani

Last edited by shabbir; 4Jan2005 at 10:06..
elec.shabnam's Avatar, Join Date: Feb 2008
Ambitious contributor
i m really weak with pointers can you suggest some good books
rlearntowin1's Avatar, Join Date: Feb 2008
Go4Expert Member
got it
soorajlal's Avatar, Join Date: Oct 2010
Newbie Member

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