hi guys,
i have overloaded the << operator.as shown below.
ostream& operator<<(ostream &out, const student &a)
{
out<<a.idno;
out<< " " ;
// out<< a.name;
out<< " " ;
// out<< a.marks << endl;
return out;
}
and
ostream& operator<<(ostream &out,string1 &s1)
{
char *p;
p=s1.c_str();
out<<p;
return out;
}
here string1 is the string class i have created and student is
class student
{
public:
string1 idno;
string1 name;
int marks;
};
now i am getting this error
no match for `std::basic_ostream<char, std::char_traits<char>
>& << const string1&' operator
at the line
out<<a.idno;
the overloaded operator << for string1 class is working for other
implementation.
kindly explain me this error.
thanking you in advance. 17 2255
Hi,
ostream& operator<<(ostream &out, const student &a)
You are accepting the reference as const .
ostream& operator<<(ostream &out,string1 &s1)
this is just reference.
out<<a.idno;
As "a" is const, this call is not working with overloaded operator
accepting non-const reference to string1.
Use this =ostream& operator<<(ostream &out,const string1 &s1)
It should work.
Regards,
Amir
Ashwin wrote:
hi guys,
i have overloaded the << operator.as shown below.
ostream& operator<<(ostream &out, const student &a)
{
out<<a.idno;
out<< " " ;
// out<< a.name;
out<< " " ;
// out<< a.marks << endl;
return out;
}
and
ostream& operator<<(ostream &out,string1 &s1)
This should read:
stream& operator<<(ostream &out,string1 const &s1)
{
char *p;
p=s1.c_str();
out<<p;
return out;
}
Is it intentional that your string class does not allow for embedded 0
characters within strings?
here string1 is the string class i have created
Why did you create your own string class? Usually, this is a BadIdea(tm),
and I am inclined to bet that your case is in that category, too.
and student is
class student
{
public:
string1 idno;
string1 name;
int marks;
};
now i am getting this error
no match for `std::basic_ostream<char, std::char_traits<char>
>& << const string1&' operator
at the line
out<<a.idno;
the overloaded operator << for string1 class is working for other
implementation.
Which other implementation?
ps.: just use std::string.
Best
Kai-Uwe Bux am******@yahoo.com wrote:
Hi,
ostream& operator<<(ostream &out, const student &a)
You are accepting the reference as const .
ostream& operator<<(ostream &out,string1 &s1)
this is just reference.
out<<a.idno;
As "a" is const, this call is not working with overloaded operator
accepting non-const reference to string1.
Use this =ostream& operator<<(ostream &out,const string1 &s1)
It should work.
Regards,
Amir
thanks Amir.
now i understand what is the problem . your explanation was very nice.
thanks a lot
Kai-Uwe Bux wrote:
Ashwin wrote:
hi guys,
i have overloaded the << operator.as shown below.
ostream& operator<<(ostream &out, const student &a)
{
out<<a.idno;
out<< " " ;
// out<< a.name;
out<< " " ;
// out<< a.marks << endl;
return out;
}
and
ostream& operator<<(ostream &out,string1 &s1)
This should read:
stream& operator<<(ostream &out,string1 const &s1)
{
char *p;
p=s1.c_str();
out<<p;
return out;
}
Is it intentional that your string class does not allow for embedded 0
characters within strings?
here string1 is the string class i have created
Why did you create your own string class? Usually, this is a BadIdea(tm),
and I am inclined to bet that your case is in that category, too.
and student is
class student
{
public:
string1 idno;
string1 name;
int marks;
};
now i am getting this error
no match for `std::basic_ostream<char, std::char_traits<char>
>& << const string1&' operator
at the line
out<<a.idno;
the overloaded operator << for string1 class is working for other
implementation.
Which other implementation?
ps.: just use std::string.
Best
Kai-Uwe Bux
thanks Kai-Uwe Bux for replying . i wrote my own string class from a
linked list as it was given to me as an assignment now i have to make
use of this string class. other implementation means other .cpp files
in which i have used my string class.
thanx and regards
ashwin
Ashwin wrote:
Kai-Uwe Bux wrote:
Ashwin wrote:
hi guys,
>
i have overloaded the << operator.as shown below.
ostream& operator<<(ostream &out, const student &a)
{
out<<a.idno;
out<< " " ;
// out<< a.name;
out<< " " ;
// out<< a.marks << endl;
return out;
}
and
ostream& operator<<(ostream &out,string1 &s1)
This should read:
stream& operator<<(ostream &out,string1 const &s1)
{
char *p;
p=s1.c_str();
out<<p;
return out;
}
Is it intentional that your string class does not allow for embedded 0
characters within strings?
here string1 is the string class i have created
Why did you create your own string class? Usually, this is a BadIdea(tm),
and I am inclined to bet that your case is in that category, too.
and student is
class student
{
public:
string1 idno;
string1 name;
int marks;
};
now i am getting this error
no match for `std::basic_ostream<char, std::char_traits<char>
>& << const string1&' operator
at the line
out<<a.idno;
the overloaded operator << for string1 class is working for other
implementation.
Which other implementation?
ps.: just use std::string.
Best
Kai-Uwe Bux
thanks Kai-Uwe Bux for replying . i wrote my own string class from a
linked list as it was given to me as an assignment now i have to make
use of this string class. other implementation means other .cpp files
in which i have used my string class.
thanx and regards
ashwin
hi guys ,
sorry to disturb you again . can any one explain me this error
/usr/include/c++/3.2.2/bits/stl_construct.h: In function `void
std::_Construct(_T1*, const _T2&) [with _T1 = student, _T2 =
student]':
/usr/include/c++/3.2.2/bits/stl_list.h:328: instantiated from
`std::_List_node<_Tp>* std::list<_Tp, _Alloc>::_M_create_node(const
_Tp&) [with _Tp = student, _Alloc = std::allocator<student>]'
/usr/include/c++/3.2.2/bits/stl_list.h:430: instantiated from
`std::_List_iterator<_Tp, _Tp&, _Tp*std::list<_Tp,
_Alloc>::insert(std::_List_iterator<_Tp, _Tp&, _Tp*>, const _Tp&) [with
_Tp = student, _Alloc = std::allocator<student>]'
/usr/include/c++/3.2.2/bits/stl_list.h:479: instantiated from `void
std::list<_Tp, _Alloc>::push_back(const _Tp&) [with _Tp = student,
_Alloc = std::allocator<student>]'
assign2.cpp:100: instantiated from here
/usr/include/c++/3.2.2/bits/stl_construct.h:78: no matching function
for call
to `student::student(const student&)'
assign2.cpp:80: candidates are: student::student()
assign2.cpp:8: student::student(student&)
at assign2.cpp:100 l.push_back(s); is present
here l is list<studentl;
and s is an object of class student.
kindly explain me this error.
Ashwin wrote:
hi guys ,
sorry to disturb you again . can any one explain me this error
I thought you were going to fix your capitalisation?
/usr/include/c++/3.2.2/bits/stl_construct.h: In function `void
std::_Construct(_T1*, const _T2&) [with _T1 = student, _T2 =
student]':
/usr/include/c++/3.2.2/bits/stl_list.h:328: instantiated from
`std::_List_node<_Tp>* std::list<_Tp, _Alloc>::_M_create_node(const
_Tp&) [with _Tp = student, _Alloc = std::allocator<student>]'
/usr/include/c++/3.2.2/bits/stl_list.h:430: instantiated from
`std::_List_iterator<_Tp, _Tp&, _Tp*std::list<_Tp,
_Alloc>::insert(std::_List_iterator<_Tp, _Tp&, _Tp*>, const _Tp&) [with
_Tp = student, _Alloc = std::allocator<student>]'
/usr/include/c++/3.2.2/bits/stl_list.h:479: instantiated from `void
std::list<_Tp, _Alloc>::push_back(const _Tp&) [with _Tp = student,
_Alloc = std::allocator<student>]'
assign2.cpp:100: instantiated from here
/usr/include/c++/3.2.2/bits/stl_construct.h:78: no matching function
for call
to `student::student(const student&)'
assign2.cpp:80: candidates are: student::student()
assign2.cpp:8: student::student(student&)
The compiler is telling you that student doesn't have a copy
constructor. Any user defined type used with a standard container must
have a public copy constructor if any other constructor is declared
because the object is copied into the container.
--
Ian Collins.
Ian Collins wrote:
Ashwin wrote:
hi guys ,
sorry to disturb you again . can any one explain me this error
I thought you were going to fix your capitalisation?
/usr/include/c++/3.2.2/bits/stl_construct.h: In function `void
std::_Construct(_T1*, const _T2&) [with _T1 = student, _T2 =
student]':
/usr/include/c++/3.2.2/bits/stl_list.h:328: instantiated from
`std::_List_node<_Tp>* std::list<_Tp, _Alloc>::_M_create_node(const
_Tp&) [with _Tp = student, _Alloc = std::allocator<student>]'
/usr/include/c++/3.2.2/bits/stl_list.h:430: instantiated from
`std::_List_iterator<_Tp, _Tp&, _Tp*std::list<_Tp,
_Alloc>::insert(std::_List_iterator<_Tp, _Tp&, _Tp*>, const _Tp&) [with
_Tp = student, _Alloc = std::allocator<student>]'
/usr/include/c++/3.2.2/bits/stl_list.h:479: instantiated from `void
std::list<_Tp, _Alloc>::push_back(const _Tp&) [with _Tp = student,
_Alloc = std::allocator<student>]'
assign2.cpp:100: instantiated from here
/usr/include/c++/3.2.2/bits/stl_construct.h:78: no matching function
for call
to `student::student(const student&)'
assign2.cpp:80: candidates are: student::student()
assign2.cpp:8: student::student(student&)
The compiler is telling you that student doesn't have a copy
constructor. Any user defined type used with a standard container must
have a public copy constructor if any other constructor is declared
because the object is copied into the container.
--
Ian Collins.
thanks Ian Collins for replying.but when i used the standard string
class without any copy constructor for the student class it didn't give
me errors why is it giving error now.
thanks and regards
Ashwin
Ashwin wrote:
Ian Collins wrote:
>>Ashwin wrote:
>>>/usr/include/c++/3.2.2/bits/stl_construct.h:78: no matching function for call to `student::student(const student&)' assign2.cpp:80: candidates are: student::student() assign2.cpp:8: student::student(student&) The compiler is telling you that student doesn't have a copy constructor. Any user defined type used with a standard container must have a public copy constructor if any other constructor is declared because the object is copied into the container.
-- Ian Collins.
It's standard practice on Usenet not to quote signatures (anything after
--).
>
thanks Ian Collins for replying.but when i used the standard string
class without any copy constructor for the student class it didn't give
me errors why is it giving error now.
Please try and fix your capitalisation, it will make your posts easier
to read.
I'm not sure what you mean, did you use std::string in place of you
student class? If so, std::string has a copy constructor. If not,
please post some code.
--
Ian Collins.
Ian Collins wrote:
Ashwin wrote:
Ian Collins wrote:
>Ashwin wrote: /usr/include/c++/3.2.2/bits/stl_construct.h:78: no matching function for call to `student::student(const student&)' assign2.cpp:80: candidates are: student::student() assign2.cpp:8: student::student(student&)
The compiler is telling you that student doesn't have a copy constructor. Any user defined type used with a standard container must have a public copy constructor if any other constructor is declared because the object is copied into the container.
-- Ian Collins.
It's standard practice on Usenet not to quote signatures (anything after
--).
thanks Ian Collins for replying.but when i used the standard string
class without any copy constructor for the student class it didn't give
me errors why is it giving error now.
Please try and fix your capitalisation, it will make your posts easier
to read.
I'm not sure what you mean, did you use std::string in place of you
student class? If so, std::string has a copy constructor. If not,
please post some code.
--
Ian Collins.
Thanks Ian Collins. I had used std:: string . Now i know where the
problem is.When i use my string class the compiler doesn't know how to
copy it to the container as it is not of standard type.Now if i write
the copy constructor for student class the compiler will know how to
load into the container, correct me if i am wrong.I hope your are happy
with the capitalisation.
Thanks and Regards
Ashwin
Ashwin wrote:
>
Ian Collins wrote:
>Ashwin wrote:
hi guys ,
sorry to disturb you again . can any one explain me this error
I thought you were going to fix your capitalisation?
/usr/include/c++/3.2.2/bits/stl_construct.h: In function `void
std::_Construct(_T1*, const _T2&) [with _T1 = student, _T2 =
student]':
/usr/include/c++/3.2.2/bits/stl_list.h:328: instantiated from
`std::_List_node<_Tp>* std::list<_Tp, _Alloc>::_M_create_node(const
_Tp&) [with _Tp = student, _Alloc = std::allocator<student>]'
/usr/include/c++/3.2.2/bits/stl_list.h:430: instantiated from
`std::_List_iterator<_Tp, _Tp&, _Tp*std::list<_Tp,
_Alloc>::insert(std::_List_iterator<_Tp, _Tp&, _Tp*>, const _Tp&) [with
_Tp = student, _Alloc = std::allocator<student>]'
/usr/include/c++/3.2.2/bits/stl_list.h:479: instantiated from `void
std::list<_Tp, _Alloc>::push_back(const _Tp&) [with _Tp = student,
_Alloc = std::allocator<student>]'
assign2.cpp:100: instantiated from here
/usr/include/c++/3.2.2/bits/stl_construct.h:78: no matching function
for call
to `student::student(const student&)'
assign2.cpp:80: candidates are: student::student()
assign2.cpp:8: student::student(student&)
The compiler is telling you that student doesn't have a copy constructor. Any user defined type used with a standard container must have a public copy constructor if any other constructor is declared because the object is copied into the container.
-- Ian Collins.
thanks Ian Collins for replying.but when i used the standard string
class without any copy constructor for the student class it didn't give
me errors why is it giving error now.
The error is somewhere in the code you did not post. Read the FAQ about how
to post. It will tell you to provide enough code for us to reproduce the
problem.
If it works with std::string instead of string1, then chances are, your
string1 class is broken and we might be seeing errors that manifest
themselves elsewhere.
Also, I doubt that you did not declare a copy constructor for student. The
compiler tells us that there is a constructor:
student::student(student&);
which qualifies as a copy constructor. However, it is not const-correct. Try
strudent( student const & );
instead.
Also, does your string1 class have a copy constructor? Is it written
const-correctly?
Best
Kai-Uwe Bux
Ashwin wrote:
>> I'm not sure what you mean, did you use std::string in place of you student class? If so, std::string has a copy constructor. If not, please post some code.
-- Ian Collins.
Thanks Ian Collins. I had used std:: string . Now i know where the
problem is.When i use my string class the compiler doesn't know how to
copy it to the container as it is not of standard type.Now if i write
the copy constructor for student class the compiler will know how to
load into the container, correct me if i am wrong.I hope your are happy
with the capitalisation.
Yes, or more precisely, know how to copy your class.
Well done on the capitalisation, one more small detail: 'I' is always
capitalised and you should add a space after each full stop (.).
Good luck,
--
Ian Collins.
Kai-Uwe Bux wrote:
Ashwin wrote:
Ian Collins wrote:
Ashwin wrote:
hi guys ,
sorry to disturb you again . can any one explain me this error
I thought you were going to fix your capitalisation?
/usr/include/c++/3.2.2/bits/stl_construct.h: In function `void
std::_Construct(_T1*, const _T2&) [with _T1 = student, _T2 =
student]':
/usr/include/c++/3.2.2/bits/stl_list.h:328: instantiated from
`std::_List_node<_Tp>* std::list<_Tp, _Alloc>::_M_create_node(const
_Tp&) [with _Tp = student, _Alloc = std::allocator<student>]'
/usr/include/c++/3.2.2/bits/stl_list.h:430: instantiated from
`std::_List_iterator<_Tp, _Tp&, _Tp*std::list<_Tp,
_Alloc>::insert(std::_List_iterator<_Tp, _Tp&, _Tp*>, const _Tp&) [with
_Tp = student, _Alloc = std::allocator<student>]'
/usr/include/c++/3.2.2/bits/stl_list.h:479: instantiated from `void
std::list<_Tp, _Alloc>::push_back(const _Tp&) [with _Tp = student,
_Alloc = std::allocator<student>]'
assign2.cpp:100: instantiated from here
/usr/include/c++/3.2.2/bits/stl_construct.h:78: no matching function
for call
to `student::student(const student&)'
assign2.cpp:80: candidates are: student::student()
assign2.cpp:8: student::student(student&)
The compiler is telling you that student doesn't have a copy
constructor. Any user defined type used with a standard container must
have a public copy constructor if any other constructor is declared
because the object is copied into the container.
--
Ian Collins.
thanks Ian Collins for replying.but when i used the standard string
class without any copy constructor for the student class it didn't give
me errors why is it giving error now.
The error is somewhere in the code you did not post. Read the FAQ about how
to post. It will tell you to provide enough code for us to reproduce the
problem.
If it works with std::string instead of string1, then chances are, your
string1 class is broken and we might be seeing errors that manifest
themselves elsewhere.
Also, I doubt that you did not declare a copy constructor for student. The
compiler tells us that there is a constructor:
student::student(student&);
which qualifies as a copy constructor. However, it is not const-correct. Try
strudent( student const & );
instead.
Also, does your string1 class have a copy constructor? Is it written
const-correctly?
Best
Kai-Uwe Bux
Thanks Kai-Uwe Bux. As you said the copy constructor is strudent(
student & ) if i use const qualifier there will be errors as i
haven't used const in the copy constuctor of string1 .so i have to
change many things in my string and linked list class.I have not used
this const qualifier regulerly so these many problems. Thanks for
replying .
Thanks and Regards
Ashwin
Ashwin wrote:
Kai-Uwe Bux wrote:
>> The error is somewhere in the code you did not post. Read the FAQ about how to post. It will tell you to provide enough code for us to reproduce the problem.
If it works with std::string instead of string1, then chances are, your string1 class is broken and we might be seeing errors that manifest themselves elsewhere.
Also, I doubt that you did not declare a copy constructor for student. The compiler tells us that there is a constructor:
student::student(student&);
Whoops, I didn't spot that, not used to gcc error messages :)
>>which qualifies as a copy constructor. However, it is not const-correct. Try
strudent( student const & );
instead.
Also, does your string1 class have a copy constructor? Is it written const-correctly?
Thanks Kai-Uwe Bux. As you said the copy constructor is strudent(
student & ) if i use const qualifier there will be errors as i
haven't used const in the copy constuctor of string1 .so i have to
change many things in my string and linked list class.I have not used
this const qualifier regulerly so these many problems. Thanks for
replying .
Copy constructors should always take a const reference as their
parameter, otherwise you will run into the exact problem you have here.
If you are not going to modify the passed value, this should be const.
--
Ian Collins.
Ian Collins wrote:
Ashwin wrote:
Kai-Uwe Bux wrote:
> The error is somewhere in the code you did not post. Read the FAQ about how to post. It will tell you to provide enough code for us to reproduce the problem.
If it works with std::string instead of string1, then chances are, your string1 class is broken and we might be seeing errors that manifest themselves elsewhere.
Also, I doubt that you did not declare a copy constructor for student. The compiler tells us that there is a constructor:
student::student(student&);
Whoops, I didn't spot that, not used to gcc error messages :)
>which qualifies as a copy constructor. However, it is not const-correct. Try
strudent( student const & );
instead.
Also, does your string1 class have a copy constructor? Is it written const-correctly?
Thanks Kai-Uwe Bux. As you said the copy constructor is strudent(
student & ) if i use const qualifier there will be errors as i
haven't used const in the copy constuctor of string1 .so i have to
change many things in my string and linked list class.I have not used
this const qualifier regulerly so these many problems. Thanks for
replying .
Copy constructors should always take a const reference as their
parameter, otherwise you will run into the exact problem you have here.
If you are not going to modify the passed value, this should be const.
--
Ian Collins.
Hi Ian Collins.As you and Kai-Uwe Bux said I have used the const
qualifier now . I have not modified it's valu but if I can another
function of the same class it is giving me errors please see the code
below.
string1::string1(const string1 &s)
{
str=new linkedlist<char>;
int i;
for(i=0;i<s.len();i++)
{
str->push_back(s[i]);
}
length=i;
}
i have added the const qualifier.
char string1::operator[](unsigned int i)
{
char ch='\0';
if(empty())
{
cout<<"no data available"<<endl;
return ch;
}
else
{
linkedlist<char>::iterator m;
str->begin(m);
for(int j=0;j!=i;j++)
{
++m;
}
return *m;
}
}
i haven't changed the value of s stored as a liked list but just
passing through the linked list using iterator and returning the
character
now this is the error
string1.h: In copy constructor `string1::string1(const string1&)':
string1.h:53: passing `const string1' as `this' argument of `int
string1::len()
' discards qualifiers
string1.h:55: passing `const string1' as `this' argument of `char
string1::operator[](unsigned int)' discards qualifiers
string1.h: In member function `int string1::operator=(const string1&)':
string1.h:77: passing `const string1' as `this' argument of `int
string1::len()
' discards qualifiers
string1.h:79: passing `const string1' as `this' argument of `char
string1::operator[](unsigned int)' discards qualifiers
assign2.cpp: In function `int main()':
assign2.cpp:87: no matching function for call to `student::student()'
assign2.cpp:16: candidates are: student::student(const student&)
so what should I do now. I was previously working on turbo c++ (not
standardised ) in that I didnot have these kind of problems.Please
suggest me some good books to get accustomed with this standardized
format of c++.
Thanks and regards
Ashwin
Ashwin wrote:
>
Hi Ian Collins.As you and Kai-Uwe Bux said I have used the const
qualifier now . I have not modified it's valu but if I can another
function of the same class it is giving me errors please see the code
below.
string1::string1(const string1 &s)
{
str=new linkedlist<char>;
int i;
for(i=0;i<s.len();i++)
{
str->push_back(s[i]);
}
length=i;
}
i have added the const qualifier.
char string1::operator[](unsigned int i)
{
char ch='\0';
if(empty())
{
cout<<"no data available"<<endl;
return ch;
}
else
{
linkedlist<char>::iterator m;
str->begin(m);
for(int j=0;j!=i;j++)
{
++m;
}
return *m;
}
}
i haven't changed the value of s stored as a liked list but just
passing through the linked list using iterator and returning the
character
now this is the error
string1.h: In copy constructor `string1::string1(const string1&)':
string1.h:53: passing `const string1' as `this' argument of `int
string1::len()
string1::len() should be declared const, it doesn't change the object.
' discards qualifiers
string1.h:55: passing `const string1' as `this' argument of `char
string1::operator[](unsigned int)' discards qualifiers
string1.h: In member function `int string1::operator=(const string1&)':
string1.h:77: passing `const string1' as `this' argument of `int
string1::len()
' discards qualifiers
string1::operator[](unsigned int) should be declared const, it doesn't
change the object.
string1.h:79: passing `const string1' as `this' argument of `char
string1::operator[](unsigned int)' discards qualifiers
assign2.cpp: In function `int main()':
assign2.cpp:87: no matching function for call to `student::student()'
assign2.cpp:16: candidates are: student::student(const student&)
student doesn't have default constructor.
so what should I do now. I was previously working on turbo c++ (not
standardised ) in that I didnot have these kind of problems.Please
suggest me some good books to get accustomed with this standardized
format of c++.
What better than the one and only "The C++ Programming Language", 3rd
edition?
--
Ian Collins.
Ian Collins wrote:
Ashwin wrote:
Hi Ian Collins.As you and Kai-Uwe Bux said I have used the const
qualifier now . I have not modified it's valu but if I can another
function of the same class it is giving me errors please see the code
below.
string1::string1(const string1 &s)
{
str=new linkedlist<char>;
int i;
for(i=0;i<s.len();i++)
{
str->push_back(s[i]);
}
length=i;
}
i have added the const qualifier.
char string1::operator[](unsigned int i)
{
char ch='\0';
if(empty())
{
cout<<"no data available"<<endl;
return ch;
}
else
{
linkedlist<char>::iterator m;
str->begin(m);
for(int j=0;j!=i;j++)
{
++m;
}
return *m;
}
}
i haven't changed the value of s stored as a liked list but just
passing through the linked list using iterator and returning the
character
now this is the error
string1.h: In copy constructor `string1::string1(const string1&)':
string1.h:53: passing `const string1' as `this' argument of `int
string1::len()
string1::len() should be declared const, it doesn't change the object.
' discards qualifiers
string1.h:55: passing `const string1' as `this' argument of `char
string1::operator[](unsigned int)' discards qualifiers
string1.h: In member function `int string1::operator=(const string1&)':
string1.h:77: passing `const string1' as `this' argument of `int
string1::len()
' discards qualifiers
string1::operator[](unsigned int) should be declared const, it doesn't
change the object.
string1.h:79: passing `const string1' as `this' argument of `char
string1::operator[](unsigned int)' discards qualifiers
assign2.cpp: In function `int main()':
assign2.cpp:87: no matching function for call to `student::student()'
assign2.cpp:16: candidates are: student::student(const student&)
student doesn't have default constructor.
so what should I do now. I was previously working on turbo c++ (not
standardised ) in that I didnot have these kind of problems.Please
suggest me some good books to get accustomed with this standardized
format of c++.
What better than the one and only "The C++ Programming Language", 3rd
edition?
--
Ian Collins.
Thanks Collins . I have mada all the changes and the code is working
now . Thanks for the help
you all provided.
Thanks and Regards
Ashwin
Ashwin wrote:
Ian Collins wrote:
>> What better than the one and only "The C++ Programming Language", 3rd edition?
-- Ian Collins.
Thanks Collins . I have mada all the changes and the code is working
now . Thanks for the help
you all provided.
Good. Now all you have to do is practice trimming your responses!
--
Ian Collins. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Julian |
last post by:
I would like to have output from my program to be written to cout as well as
a file. (actually, i want several other output options but this should
explain my problem in the simplest way). I have...
|
by: pmatos |
last post by:
Hi all,
I have the following code:
class test {
public:
test(const std::string *n) : name(n) {}
virtual ~test() {}
const std::string * getName() { return name; }
|
by: pmatos |
last post by:
Hi all,
I'm having a problem and for illustration purposes I developed code
that shows what the problem is about. However, any comment on the code
which is not directly about this issue is...
|
by: zeroYouMustNotSpamtype |
last post by:
Hi,
Describing this problem will be a bit long winded, but please bear
with me:
I've got three files in my project: permuts.h, permuts.cpp, and
braids.cpp (some content from wich will...
|
by: jois.de.vivre |
last post by:
Hi, I'm having some trouble overloading the << operator. I have the
following, very simple code:
#include <iostream>
using namespace std;
class test
{
private:
int val;
|
by: Suresh Tri |
last post by:
Hi all,
I was trying to overload '<' operator for (varchar,varchar). But in
the function which handles the comparision I want to use the previous
'<' operator.. but it is going into a recursion....
|
by: atomik.fungus |
last post by:
Hi, as many others im making my own matrix class, but the compiler is
giving me a lot of errors related to the friend functions which
overload >> and <<.I've looked around and no one seems to get...
|
by: Ashwin |
last post by:
FamilyNet International Newsgate
From: "Ashwin" <ashwin.bevinje@gmail.com>
Kai-Uwe Bux wrote:
Thanks Kai-Uwe Bux. As you said the copy constructor is strudent(
|
by: Goran |
last post by:
Hi all,
I have a question regarding operator <<.
A lib of mine contains a class with an overloaded operator << as NON-
class member. This would look like:
#include <iostream>
#include...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM)
The start time is equivalent to 19:00 (7PM) in Central...
|
by: Aliciasmith |
last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
|
by: tracyyun |
last post by:
Hello everyone,
I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
|
by: giovanniandrean |
last post by:
The energy model is structured as follows and uses excel sheets to give input data:
1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
|
by: NeoPa |
last post by:
Introduction
For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM)
Please note that the UK and Europe revert to winter time on...
|
by: nia12 |
last post by:
Hi there,
I am very new to Access so apologies if any of this is obvious/not clear.
I am creating a data collection tool for health care employees to complete. It consists of a number of...
|
by: GKJR |
last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...
|
by: SueHopson |
last post by:
Hi All,
I'm trying to create a single code (run off a button that calls the Private Sub) for our parts list report that will allow the user to filter by either/both PartVendor and PartType. On...
| |