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?
hay princess can u attach these file in note pad form i mean .txt???
jst a moment.
ok i'll wait
shall I attach as word doc.?
yeah its also fine
i'll looking at it actually i m not good at c++ anyhow i'll do something
Np. Thank you so much for trying to help.
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
Bt if i include .h my compiler shows many errors. I am using Dev C++
It works nw. I included the names within double quotation marks.
i m not familiar with dev c++
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.
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.
Join our real-time social learning platform and learn together with your friends!