delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/11/15/02:39:43

From: "Raul Carolus" <carolura AT luther DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Debugging Rhide C++ Struct
Date: Mon, 15 Nov 1999 08:17:11 +0100
Organization: T-Online
Lines: 50
Message-ID: <80oc2j$rsh$1@news05.btx.dtag.de>
References: <80mtke$baf$1 AT wanadoo DOT fr>
Mime-Version: 1.0
X-Trace: news05.btx.dtag.de 942650259 28561 320030026865-0001 991115 07:17:39
X-Complaints-To: abuse AT t-online DOT de
X-Sender: 320030026865-0001 AT t-dialin DOT net
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2615.200
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Regis DUPUY <regis DOT dupuy AT wanadoo DOT fr> schrieb in im Newsbeitrag:
80mtke$baf$1 AT wanadoo DOT fr...
> The little program below wich is a c++ example for struct compile
> and run but I can't trace it with F7 (rhide debugger)
> it jumps over the first line  :  point a,b;
> then it trace back ,then it stay at the same place and it ends
> is it impossible to debug C++ program with rhide if those programs
> have struct definitions ?


>  #include <iostream.h>
>  struct point
>
>
>    int x;
>    int y;
>    void initialise(int,int);
>    void deplace(int,int);
>    void affiche();
>  };
>  void point::initialise(int abs,int ord)
>  {x=abs;y=ord;}
>  void point::deplace(int dx,int dy)
>  {x+=dx;y+=dy;}
>  void point::affiche()
>  {cout <<"je suis en "<<x<<" "<<y<<"\n";}
>  int main()
>
>
>    point a,b;
>    a.initialise(5,2);
>    a.affiche();
>    a.deplace(-2,4);
>    a.affiche();
>    b.initialise(1,-1);
>    b.affiche();
>    return 0;
>  }
>
The problem you have with this is, you're trying to use a struct like a
class.  Try defining your struct as a class, and see if that helps.

BTW, it skips over the point a, b; line, because that only declares some
variables.  Almost all of the debuggers that I've encountered will skip over
variable declarations.

Good Luck


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019