From: Andre Kirchner <supercroc1974@yahoo.com>
To: gcc-help@gcc.gnu.org
Subject: non-aggregate type problem
Date: Tue, 20 Jul 2004 22:14:00 -0000 [thread overview]
Message-ID: <20040720221450.97668.qmail@web50510.mail.yahoo.com> (raw)
Hi,
could someone please explain me the meaning of
"request for member `sendMessage' in
'this->Sender::theConnector', which is of
non-aggregate type `Connector*'"?
In the following code I created an object Connector
called theConnector. Then when I created an object
Sender called theSender, I passed a pointer to
theConnector as a parameter.
I thought it would allow the to use theConnector
object inside theSender, but for some reason it is not
working.
Thanks,
Andre
-------------------------------------------------
main.cpp:
#ifndef MAIN
# define MAIN
# include "main.h"
#endif
int main( int argc, char *argv[] )
{
char theMessage[ 256 ];
Connector theConnector;
Sender theSender( &theConnector );
bzero( theMessage, 256 );
theConnector.establishConnection( "65.54.252.99",
25 );
theConnector.receiveMessage( theMessage, 255 );
printf( "%s\n", theMessage );
theSender.sendHELO();
theConnector.receiveMessage( theMessage, 255 );
printf( "%s\n", theMessage );
theConnector.closeConnection();
return ( EXIT_SUCESS );
}
____________________________________________
Sender.h:
#ifndef STRING
# define STRING
# include <string.h>
#endif
#ifndef CONNECTOR
# define CONNECTOR
# include "Connector.h"
#endif
class Sender
{
public:
Sender(){};
Sender( Connector * newConnector );
~Sender(){};
int setOrigin( const char * newOrigin );
int setDestiny( const char * newDestiny );
int setData( const char * newData );
int sendHELO();
int sendMAILFROM();
int sendRCPT();
int sendDATA();
private:
char theOrigin[ 256 ], theDestiny[ 256 ], theData[
256 ];
Connector * theConnector;
};
_____________________________________________
Sender.cpp:
#ifndef SENDER
# define SENDER
# include "Sender.h"
#endif
int Sender::sendHELO()
{
theConnector.sendMessage( "HELO test" );
}
_________________________________________________
Connector.h:
class Connector
{
public:
Connector(){};
~Connector(){};
int establishConnection( const char *
theMailServerName, int thePortNumber );
int sendMessage( const char * theMessage );
int receiveMessage( char * theMessage, int
theMessageLength );
int closeConnection();
private:
int sockfd;
};
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
next reply other threads:[~2004-07-20 22:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-20 22:14 Andre Kirchner [this message]
2004-07-23 9:31 ` Stuart Brooks
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040720221450.97668.qmail@web50510.mail.yahoo.com \
--to=supercroc1974@yahoo.com \
--cc=gcc-help@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).