This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Is there anybody got this
message?
When I debug test5.cc program,
I set a breakpoint in main(), run the
program.
I step and step,
then I got an message "0x40e3e7 in
LM44()".
Kong Seon Lee
test5.cc
#include <iostream.h>
#include <stdlib.h> #include <string.h> class baseA
{ public: baseA(){}; baseA(int i) { objID = i;}; ~baseA(){}; private: int objID; }; class A : public baseA
{ public: A(); A(char *name, unsigned age); virtual ~A(); A& operator=(A &rhs); const char *getName() const; void getName(char *name, size_t len) const; int getAge() const; void setName(char *name); void setAge(unsigned age); private: char *name_; unsigned age_; }; A::A() : name_(NULL), age_(0) {} A::A(char *name, unsigned age) { // if (name_ != NULL) // free(name_); name_ = (char *)malloc(strlen(name) + 1); strcpy(name_, name); age_ = age; } A::~A() { free(name_); } A& A::operator=(A &rhs) { name_= rhs.name_; age_ = rhs.age_; } inline const char *
A::getName() const { return name_; } void
A::getName(char *name, size_t len) const { name = (char *)malloc(len + 1); strncpy(name, name_, len); } int
A::getAge() const { return age_; } void
A::setName(char *name) { if (name_ != NULL) free(name_); name_ = (char *)malloc(strlen(name) + 1); strcpy(name_, name); } void
A::setAge(unsigned age) { age_ = age; } void
StrangeFunction_12345678901234567890123456789012345678901234567890(long number, long no2, long no3) { cout << number << " " << no2 << " " << no3 << endl; } void main() { A a("bill", 24), b("michael", 23); cout << a.getName() <<
a.getAge() << endl;
cout << b.getName() << b.getAge() << endl; a = b; cout << a.getName() << a.getAge() << endl; cout << b.getName() << b.getAge() << endl; StrangeFunction_12345678901234567890123456789012345678901234567890(1234567890, 1234567890, 1234567890); } |
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |