Ask your own question, for FREE!
Computer Science 8 Online
OpenStudy (ajprincess):

Can someone please chck this coding? I want name, age and salary of both the persons to be displayed. But names are not being displayed. Can someone suggest me the reason for this?

OpenStudy (ajprincess):

OpenStudy (anonymous):

hay princess can u attach these file in note pad form i mean .txt???

OpenStudy (ajprincess):

jst a moment.

OpenStudy (anonymous):

ok i'll wait

OpenStudy (ajprincess):

shall I attach as word doc.?

OpenStudy (anonymous):

yeah its also fine

OpenStudy (ajprincess):

OpenStudy (anonymous):

i'll looking at it actually i m not good at c++ anyhow i'll do something

OpenStudy (ajprincess):

Np. Thank you so much for trying to help.

OpenStudy (anonymous):

my turbo c is giving 13 errors the main error that i figured out was the iostream.h you have to give an extension .h because it is a header file and for other i have tried hard but i m sorry... i know java and c very well ... i tried but i m so sorry

OpenStudy (ajprincess):

Bt if i include .h my compiler shows many errors. I am using Dev C++

OpenStudy (ajprincess):

It works nw. I included the names within double quotation marks.

OpenStudy (anonymous):

i m not familiar with dev c++

OpenStudy (rsmith6559):

Your calls to R.display() and M.display() happen when R.name and M.name are NULL, so it would look like they're not being displayed. If you're comfortable that your setters work, create the objects with real values, or move the display() calls to the end.

OpenStudy (anonymous):

One thing I noticed in your code is that you did not #include<string> The only other detail is you forgot one very important thing. Change: string Rakesh, Mitul; to string Rakesh = "Rakesh", Mitul = "Mitul"; This will make it so Rakesh and Mitul actually have the strings stored in them. It's confusing at first with C++, but when you declare a variable, think of it as setting aside space for whatever information you need the variable for. After you set aside the space, you can put data in it and call that data using the variable name to your heart's desire.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!