Thread: RE: [Dev-C++] compiling project fails
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: <Mat...@Ve...> - 2005-03-21 14:18:02
|
class CBruchzahlen
{
private:
long lZaehler;
long lNenner;
=20
public:
void sayHello(char * message);
=20
};
Note that there must be a semicolon after the class declaration, just like
for a struct. I inserted it in the right place in the code above. This
stupid idea was eliminated in Java, but sadly still remained in C++.
HTH!
Matt
-----Original Message-----
From: dev...@li...
[mailto:dev...@li...]On Behalf Of Markus
D=FCrauer LM
Sent: Saturday, March 19, 2005 7:49 AM
To: dev...@li...
Subject: [Dev-C++] compiling project fails
Need help!
When compiling the following dev-c++ project I get some errors:
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
int a;
a =3D cin.get();
}
class CBruchzahlen
{
private:
long lZaehler;
long lNenner;
=20
public:
void sayHello(char * message);
=20
}
void CBruchzahlen::sayHello(char * message)
{
cout << "Test"; =20
}
Errors:
-) new types may not be defined in a return type
-) two or more data types in declaration of `sayHello'
-) prototype for `CBruchzahlen CBruchzahlen::sayHello(char*)' does not match
any in class `CBruchzahlen'
Can anyone help?
Markus
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=3D6595&alloc_id=3D14396&op=3Dclick
_______________________________________________
Dev-cpp-users mailing list
Dev...@li...
TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
___________________________________________________________________
The information contained in this message and any attachment may be
proprietary, confidential, and privileged or subject to the work
product doctrine and thus protected from disclosure. If the reader
of this message is not the intended recipient, or an employee or
agent responsible for delivering this message to the intended
recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited.
If you have received this communication in error, please notify me
immediately by replying to this message and deleting it and all
copies and backups thereof. Thank you.
|
|
From: <Mat...@Ve...> - 2005-03-21 20:30:56
|
You see it how you see it. I see it how I see it. I look at a class as being
more like a namespace than like an enumeration or structure. You look at a
class as being more like an enumeration or structure than like a namespace.
This difference in belief is trivial and irreconcilable; therefore, QED, let
us not continue debating it.
-----Original Message-----
From: Per Westermark [mailto:pw...@ia...]
Sent: Monday, March 21, 2005 12:03 PM
To: Mat...@Ve...
Cc: m.d...@fe...;
dev...@li...
Subject: RE: [Dev-C++] compiling project fails
I can't really see what stupidity there is to require a semicolon after a
type or data declaration. There is really no difference from
enum Color { RED, GREEN, BLUE };
int hello,there;
typedef unsigned Age;
struct Person {
std::string name;
Age age;
};
unsigned short seed[] = {0x18da,0xbc3c,0x52f4,0x5100};
...
/Per W
> Note that there must be a semicolon after the class declaration, just like
> for a struct. I inserted it in the right place in the code above. This
> stupid idea was eliminated in Java, but sadly still remained in C++.
>
> HTH!
> Matt
___________________________________________________________________
The information contained in this message and any attachment may be
proprietary, confidential, and privileged or subject to the work
product doctrine and thus protected from disclosure. If the reader
of this message is not the intended recipient, or an employee or
agent responsible for delivering this message to the intended
recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited.
If you have received this communication in error, please notify me
immediately by replying to this message and deleting it and all
copies and backups thereof. Thank you.
|
|
From: Per W. <pw...@ia...> - 2005-03-21 22:10:52
|
But just a short note:
What would you do with:
struct Person {
std::string name;
unsigned age;
bool Save(mystream& s);
bool Load(mystream& s);
};
A struct that is a class? The only difference between a struct and a class
is the default protection.
/Per W
On Mon, 21 Mar 2005 Mat...@Ve... wrote:
> You see it how you see it. I see it how I see it. I look at a class as being
> more like a namespace than like an enumeration or structure. You look at a
> class as being more like an enumeration or structure than like a namespace.
>
> This difference in belief is trivial and irreconcilable; therefore, QED, let
> us not continue debating it.
|
|
From: <Mat...@Ve...> - 2005-03-22 01:12:16
|
Really my opinion of this is the same but it was not the subject of the
original poster's mail; therefore, until now, I had refrained from
discussing it. If it were up to me this semicolon would also be eliminated
since it really seems spurious.
One quibble about your characterization of structs as being classes with
different protection: functions in structs definitely do not get called like
functions in classes, nor do they behave the same way inside the compiler.
-----Original Message-----
From: Per Westermark [mailto:pw...@ia...]
Sent: Monday, March 21, 2005 2:11 PM
To: Mat...@Ve...
Cc: m.d...@fe...;
dev...@li...
Subject: RE: [Dev-C++] compiling project fails
But just a short note:
What would you do with:
struct Person {
std::string name;
unsigned age;
bool Save(mystream& s);
bool Load(mystream& s);
};
A struct that is a class? The only difference between a struct and a class
is the default protection.
/Per W
On Mon, 21 Mar 2005 Mat...@Ve... wrote:
> You see it how you see it. I see it how I see it. I look at a class as
being
> more like a namespace than like an enumeration or structure. You look at a
> class as being more like an enumeration or structure than like a
namespace.
>
> This difference in belief is trivial and irreconcilable; therefore, QED,
let
> us not continue debating it.
___________________________________________________________________
The information contained in this message and any attachment may be
proprietary, confidential, and privileged or subject to the work
product doctrine and thus protected from disclosure. If the reader
of this message is not the intended recipient, or an employee or
agent responsible for delivering this message to the intended
recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited.
If you have received this communication in error, please notify me
immediately by replying to this message and deleting it and all
copies and backups thereof. Thank you.
|
|
From: Josh M. <mrl...@gm...> - 2005-03-22 03:30:36
|
Whoops, sent my reply to Matthew only. My mistake.
The semi-colon is there because you're able to create instances of
classes right after declaring them, and before the semi-colon. That
sounds pretty logical to me.
On Mon, 21 Mar 2005 17:12:05 -0800, Mat...@ve...
<Mat...@ve...> wrote:
> Really my opinion of this is the same but it was not the subject of the
> original poster's mail; therefore, until now, I had refrained from
> discussing it. If it were up to me this semicolon would also be eliminated
> since it really seems spurious.
>
> One quibble about your characterization of structs as being classes with
> different protection: functions in structs definitely do not get called like
> functions in classes, nor do they behave the same way inside the compiler.
>
> -----Original Message-----
> From: Per Westermark [mailto:pw...@ia...]
> Sent: Monday, March 21, 2005 2:11 PM
> To: Mat...@Ve...
> Cc: m.d...@fe...;
> dev...@li...
> Subject: RE: [Dev-C++] compiling project fails
>
> But just a short note:
>
> What would you do with:
>
> struct Person {
> std::string name;
> unsigned age;
> bool Save(mystream& s);
> bool Load(mystream& s);
> };
>
> A struct that is a class? The only difference between a struct and a class
> is the default protection.
>
> /Per W
>
> On Mon, 21 Mar 2005 Mat...@Ve... wrote:
>
> > You see it how you see it. I see it how I see it. I look at a class as
> being
> > more like a namespace than like an enumeration or structure. You look at a
> > class as being more like an enumeration or structure than like a
> namespace.
> >
> > This difference in belief is trivial and irreconcilable; therefore, QED,
> let
> > us not continue debating it.
> ___________________________________________________________________
> The information contained in this message and any attachment may be
> proprietary, confidential, and privileged or subject to the work
> product doctrine and thus protected from disclosure. If the reader
> of this message is not the intended recipient, or an employee or
> agent responsible for delivering this message to the intended
> recipient, you are hereby notified that any dissemination,
> distribution or copying of this communication is strictly prohibited.
> If you have received this communication in error, please notify me
> immediately by replying to this message and deleting it and all
> copies and backups thereof. Thank you.
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|
|
From: Per W. <pw...@ia...> - 2005-03-22 12:43:04
|
Exactly what difference is there between struct and class except for their
initial difference in protection?
A struct supports constructors, multiple inherritance, virtual methods,
operator overloading, ... etc just as a class. If you have found a
difference somewhere, please point me at that difference
(compiler and/or standard paragraph).
You can take any C++ application and replace
class xx : yy {
...
};
with:
struct xx : yy {
private:
...
};
directly, for identical functionality.
The only difference/limitation I can think about right now is that
template declarations only accept the "class" or "typename" keyword.
/Per W
On Mon, 21 Mar 2005 Mat...@Ve... wrote:
> One quibble about your characterization of structs as being classes with
> different protection: functions in structs definitely do not get called like
> functions in classes, nor do they behave the same way inside the compiler.
|
|
From: Per W. <pw...@ia...> - 2005-03-21 20:07:40
|
I can't really see what stupidity there is to require a semicolon after a
type or data declaration. There is really no difference from
enum Color { RED, GREEN, BLUE };
int hello,there;
typedef unsigned Age;
struct Person {
std::string name;
Age age;
};
unsigned short seed[] = {0x18da,0xbc3c,0x52f4,0x5100};
...
/Per W
> Note that there must be a semicolon after the class declaration, just like
> for a struct. I inserted it in the right place in the code above. This
> stupid idea was eliminated in Java, but sadly still remained in C++.
>
> HTH!
> Matt
|