Thank you Sir, I could get the point.
Type: Posts; User: rm82co
Thank you Sir, I could get the point.
Following are compilation errors
Defining as const, a member function that modifies a data member of an object
Defining as const, a member function that calls a non-const member function of the...
Defining as const, a member function that calls a non-const member function of the class on the same instance of the class
What is the meaning of the above sentence? Can anybody please explain...
I have done Sir, thank you very much. It is working now.
Thank you very much
#include<iostream>
#include<cstdlib>
using namespace std;
class Time{
private:
Yup I have done it in this way. Still same issue.
Still same issue
Please check the code and output.
I've checked again and again but could not sort out the flaw.
Kindly help please!
15793
#include<iostream>
#include<cstdlib>
using namespace std;
Yeah! there were two errors. One as you are indicating to and the other I haven't used using namespace std;
Well I've identified error. Thanks for all
#include<iostream>
#include<cstdlib>
#include<string>
class GradeBook{
private:
string name;
public:
Well, I've gotten the answer
Error is as following,
In member function 'void ObPass::disp3()':
[ERROR] no matching function for call to 'getline(std::istream&, char[40])'
void disp3(){
cout << "Enter Name: " << endl;
getline(cin,name);
cout << "Enter Integer: " << endl;
cin >> n;
cout<<"Enter...
#include <iostream>
#include<cstdlib>
using namespace std;
class ObPass {
private:
char name[40] = "Javaid Iqbal";
Well another question is if we need to add namespace statement or std prefix, we'll need to add it in our program and then compiler first will check in our program namespace statement or prefix std ...
Yup I have checked already through compiler but actually I am beginner. So, one question get satisfied another arose.
I observed that when I include C header files in my CPP program, It compiled...
It is said that we can use cstdlib and stdlib.h header file as well.
My question is how can we use C language header file to fetch prototype of functions here in CPP too? Are C and CPP header...
It is said that we can use cstdlib and stdlib.h file as well. My question is how can we use C language libraries functions here in CPP too? Are C and CPP libraries available for both, C and CPP?
Thank you. Actually I know those are functions and not automatically called. Because these operators in itself are functions. Anyway up have been told about constructors. I think my reply exist in...
Sir, I'm beginner in C++. Can you please tell me that if string member functions are executed automatically? Because when we create an string object. I see not a call of member function.
When we use class string, we create an string object. what is about its member functions? We don't call them except the function that overload operator <<>>
So, my confusion is, how do, and where...
You're best teacher. I could get the point
Thanks you both replied
#include <iostream>
using namespace std;
class ObPass {
private:
char name[40];
int n;
char ch;
public:
void disp(ObPass objectpass){
cout << "Enter Name: " << endl;
string name;
cout<< name << endl;
Will the above statement display an object?
I was told that object. (class data member)
But here we are passing direct to a string object. And It works too....