Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C++ (http://www.go4expert.com/forums/cpp/)
-   -   We can do in C but not in C++ (http://www.go4expert.com/forums/c-cpp-t230/)

arangasoft 3Jan2005 17:20

We can do in C but not in C++
 
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...

shabbir 4Jan2005 10:02

RE: We can do in C but not in C++
 
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/intervi...ogramming.html

Thanks
Shabbir Bhimani

elec.shabnam 26Feb2008 17:14

Re: We can do in C but not in C++
 
i m really weak with pointers can you suggest some good books

rlearntowin1 27Feb2008 09:30

Re: We can do in C but not in C++
 
got it

soorajlal 21Oct2010 21:17

Re: We can do in C but not in C++
 
hai,


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


All times are GMT +5.5. The time now is 18:59.