Thread: [Dev-C++] Help me with debugging pls.
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Vaclav K. <vk...@se...> - 2002-07-31 14:44:20
|
Hello all,
here is my short code:
#include <iostream.h>
#include <stdio.h>
#include <stdlib.h>
int main (int argc, char *argv[])
{
int x =3D 1000;
x =3D x*x;
cout << "Hello World!" << endl;
x =3D 1;
cout << "Press ENTER to continue... " << x <<endl;
getchar ();
return 0;
}
I need to watch variable x, but when I step in code while debugging each=
line with x is skiped and no x value is displayed. Only three lines (cout=
and getchar) are evaluated correctly.
Some error "No symbol x in current context." is displayed in debugging=
infos.
Does anyone know where is the problem, can you try it by yourself and write=
me your status? I need to watch variables values while debugging because=
otherwise it is not valuable for me. I have devcpp.exe 4.9.4.3.
Thank you very much for your help.
With best regards,
Vaclav Kremen.
|
|
From: Ioannis V. <no...@ho...> - 2002-08-01 09:37:37
|
I do not know the GDB thing but i have to make your code ANSI C++
compliant. :)
Ioannis
-----Original Message-----
From: dev...@li...
[mailto:dev...@li...] On Behalf Of Vaclav
Kremen
Sent: Wednesday, July 31, 2002 5:44 PM
To: dev...@li...
Subject: [Dev-C++] Help me with debugging pls.
Hello all,
here is my short code:
#include <iostream.h>
#include <iostream>
#include <stdio.h>
Or better: #include <cstdio>
#include <stdlib.h>
Or better: #include <cstdlib>
int main (int argc, char *argv[])
{
int argc, char *argv[] are not used, so they are not needed.
using namespace std;
int x = 1000;
x = x*x;
cout << "Hello World!" << endl;
x = 1;
cout << "Press ENTER to continue... " << x <<endl;
getchar ();
or better: cin.ignore(); So <cstdio> is not needed.
return 0;
}
Ioannis
* Ioannis Vranos
* Programming pages: <http://www.noicys.cjb.net/>
http://www.noicys.cjb.net
* Alternative URL: <http://run.to/noicys> http://run.to/noicys
|
|
From: Ramana K. <ra...@my...> - 2002-08-05 11:31:06
|
Just one comment, Ioannis, writing the following:
using namespace std;
completely defeats the purpose of namespaces, as it just includes everything
within the std namespace, including those things that are not needed.
Instead, I suggest writing:
using std::cout;
using std::system;
//etc
at the top of whichever file needs these functions.
-----Original Message-----
From: dev...@li...
[mailto:dev...@li...]On Behalf Of Ioannis
Vranos
Sent: Thursday, 1 August 2002 7:37 PM
To: dev...@li...
Subject: RE: [Dev-C++] Help me with debugging pls.
I do not know the GDB thing but i have to make your code ANSI C++ compliant.
:)
Ioannis
-----Original Message-----
From: dev...@li...
[mailto:dev...@li...] On Behalf Of Vaclav
Kremen
Sent: Wednesday, July 31, 2002 5:44 PM
To: dev...@li...
Subject: [Dev-C++] Help me with debugging pls.
Hello all,
here is my short code:
#include <iostream.h>
#include <iostream>
#include <stdio.h>
Or better: #include <cstdio>
#include <stdlib.h>
Or better: #include <cstdlib>
int main (int argc, char *argv[])
{
int argc, char *argv[] are not used, so they are not needed.
using namespace std;
int x = 1000;
x = x*x;
cout << "Hello World!" << endl;
x = 1;
cout << "Press ENTER to continue... " << x <<endl;
getchar ();
or better: cin.ignore(); So <cstdio> is not needed.
return 0;
}
Ioannis
* Ioannis Vranos
* Programming pages: http://www.noicys.cjb.net
* Alternative URL: http://run.to/noicys
|
|
From: Ioannis V. <no...@ho...> - 2002-08-05 12:35:16
|
> -----Original Message----- > From: Ramana Kumar [mailto:ra...@my...] > Sent: Monday, August 05, 2002 2:30 PM > To: Ioannis Vranos; C++ > Subject: RE: [Dev-C++] Help me with debugging pls. > > > Just one comment, Ioannis, writing the following: > > using namespace std; > > completely defeats the purpose of namespaces, as it just > includes everything > within the std namespace, including those things that are not needed. > Instead, I suggest writing: > > using std::cout; > using std::system; > //etc > > at the top of whichever file needs these functions. :) Well the using std::thing is elegant when used for only 2-3 names. Here indeed we could do that since we use only cout, endl, and getchar(). The using namespace std; is an attempt to defeat the namespace system when we use it in global scope (as many folks do) and i think everyone can realise that. Well i am using it in local scope. So in summary, use using std::thing when there are only 2-4 names and using namespace std; when there are more. And these, in as small scope as possible. So, the using namespace something; and using something::thing are not prohibited in local scopes. :) Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.cjb.net * Alternative URL: http://run.to/noicys > > -----Original Message----- > From: dev...@li... > [mailto:dev...@li...]On Behalf Of Ioannis > Vranos > Sent: Thursday, 1 August 2002 7:37 PM > To: dev...@li... > Subject: RE: [Dev-C++] Help me with debugging pls. > > > I do not know the GDB thing but i have to make your code ANSI > C++ compliant. > :) > > > Ioannis > > > > -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf Of Vaclav > Kremen > Sent: Wednesday, July 31, 2002 5:44 PM > To: dev...@li... > Subject: [Dev-C++] Help me with debugging pls. > > > Hello all, > here is my short code: > > #include <iostream.h> > > #include <iostream> > > #include <stdio.h> > > Or better: #include <cstdio> > > > #include <stdlib.h> > > > Or better: #include <cstdlib> > > int main (int argc, char *argv[]) > { > > int argc, char *argv[] are not used, so they are not needed. > > using namespace std; > > int x = 1000; > > x = x*x; > cout << "Hello World!" << endl; > x = 1; > cout << "Press ENTER to continue... " << x <<endl; > getchar (); > > > or better: cin.ignore(); So <cstdio> is not needed. > > > return 0; > } > > > Ioannis > > * Ioannis Vranos > * Programming pages: http://www.noicys.cjb.net > * Alternative URL: http://run.to/noicys > |
|
From: Ioannis V. <no...@ho...> - 2002-08-05 12:37:29
|
> -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of Ramana Kumar > Sent: Monday, August 05, 2002 2:30 PM > To: Ioannis Vranos; C++ > Subject: RE: [Dev-C++] Help me with debugging pls. > > Instead, I suggest writing: > > using std::cout; > using std::system; > //etc > > at the top of whichever file needs these functions. As i said in the other email, you should not use them in global scope of the file! Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.cjb.net * Alternative URL: http://run.to/noicys |
|
From: Roberto R. <rob...@ar...> - 2002-08-04 23:33:51
|
Vaclav Kremen wrote:
> Hello all,
> here is my short code:
>
> #include <iostream.h>
> #include <stdio.h>
> #include <stdlib.h>
>
> int main (int argc, char *argv[])
> {
> int x = 1000;
>
> x = x*x;
> cout << "Hello World!" << endl;
> x = 1;
> cout << "Press ENTER to continue... " << x <<endl;
> getchar ();
>
> return 0;
> }
>
> I need to watch variable x, but when I step in code while debugging
> each line with x is skiped and no x value is displayed. Only three
> lines (cout and getchar) are evaluated correctly.
> Some error "No symbol x in current context." is displayed in debugging
> infos.
>
> Does anyone know where is the problem, can you try it by yourself and
> write me your status? I need to watch variables values while debugging
> because otherwise it is not valuable for me. I have devcpp.exe 4.9.4.3.
> Thank you very much for your help.
>
> With best regards,
>
> Vaclav Kremen.
Try looking this:
ftp://161.97.203.92/pub/insight5_win32_exe.zip
http://www.geocities.com/uniqueness_template/
or just in www.bloodshet.net
Install insight5 overwrite dgb in Dev-C++ but works fine (the interfase
is clear to see), dbg in Dev-C++ have some problems up to now, almost I
think. Both applications run friendly.
Roberto
|