dev-cpp-users Mailing List for Dev-C++ (Page 377)
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
You can subscribe to this list here.
| 2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(15) |
Oct
(115) |
Nov
(154) |
Dec
(258) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2001 |
Jan
(377) |
Feb
(260) |
Mar
(249) |
Apr
(188) |
May
(152) |
Jun
(150) |
Jul
(195) |
Aug
(202) |
Sep
(200) |
Oct
(286) |
Nov
(242) |
Dec
(165) |
| 2002 |
Jan
(245) |
Feb
(241) |
Mar
(239) |
Apr
(346) |
May
(406) |
Jun
(369) |
Jul
(418) |
Aug
(357) |
Sep
(362) |
Oct
(597) |
Nov
(455) |
Dec
(344) |
| 2003 |
Jan
(446) |
Feb
(397) |
Mar
(515) |
Apr
(524) |
May
(377) |
Jun
(387) |
Jul
(532) |
Aug
(364) |
Sep
(294) |
Oct
(352) |
Nov
(295) |
Dec
(327) |
| 2004 |
Jan
(416) |
Feb
(318) |
Mar
(324) |
Apr
(249) |
May
(259) |
Jun
(218) |
Jul
(212) |
Aug
(259) |
Sep
(158) |
Oct
(162) |
Nov
(214) |
Dec
(169) |
| 2005 |
Jan
(111) |
Feb
(165) |
Mar
(199) |
Apr
(147) |
May
(131) |
Jun
(163) |
Jul
(235) |
Aug
(136) |
Sep
(84) |
Oct
(88) |
Nov
(113) |
Dec
(100) |
| 2006 |
Jan
(85) |
Feb
(119) |
Mar
(33) |
Apr
(31) |
May
(56) |
Jun
(68) |
Jul
(18) |
Aug
(62) |
Sep
(33) |
Oct
(55) |
Nov
(19) |
Dec
(40) |
| 2007 |
Jan
(22) |
Feb
(49) |
Mar
(34) |
Apr
(51) |
May
(66) |
Jun
(43) |
Jul
(116) |
Aug
(57) |
Sep
(70) |
Oct
(69) |
Nov
(97) |
Dec
(86) |
| 2008 |
Jan
(32) |
Feb
(47) |
Mar
(106) |
Apr
(67) |
May
(28) |
Jun
(39) |
Jul
(31) |
Aug
(25) |
Sep
(18) |
Oct
(25) |
Nov
(5) |
Dec
(21) |
| 2009 |
Jan
(33) |
Feb
(27) |
Mar
(27) |
Apr
(22) |
May
(22) |
Jun
(10) |
Jul
(17) |
Aug
(9) |
Sep
(21) |
Oct
(13) |
Nov
(4) |
Dec
(11) |
| 2010 |
Jan
(10) |
Feb
(8) |
Mar
(4) |
Apr
(1) |
May
|
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(8) |
Oct
(26) |
Nov
(9) |
Dec
(1) |
| 2011 |
Jan
(21) |
Feb
(16) |
Mar
(4) |
Apr
(19) |
May
(26) |
Jun
(9) |
Jul
(6) |
Aug
|
Sep
(4) |
Oct
(3) |
Nov
(2) |
Dec
(1) |
| 2012 |
Jan
(4) |
Feb
(7) |
Mar
(4) |
Apr
|
May
(1) |
Jun
(10) |
Jul
(1) |
Aug
(1) |
Sep
(18) |
Oct
(3) |
Nov
(1) |
Dec
(1) |
| 2013 |
Jan
(4) |
Feb
(2) |
Mar
(15) |
Apr
(6) |
May
(1) |
Jun
(3) |
Jul
(1) |
Aug
(2) |
Sep
(4) |
Oct
|
Nov
(9) |
Dec
|
| 2014 |
Jan
(4) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(5) |
Aug
(4) |
Sep
|
Oct
(2) |
Nov
(1) |
Dec
(4) |
| 2015 |
Jan
(2) |
Feb
(3) |
Mar
(1) |
Apr
(2) |
May
(1) |
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(2) |
Oct
(9) |
Nov
(35) |
Dec
(6) |
| 2016 |
Jan
(7) |
Feb
(10) |
Mar
(10) |
Apr
(9) |
May
(13) |
Jun
(9) |
Jul
(1) |
Aug
(3) |
Sep
(3) |
Oct
(1) |
Nov
(1) |
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2018 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2019 |
Jan
(1) |
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2020 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Luigi S. <gi...@li...> - 2003-05-29 05:37:32
|
On Wed, May 28, 2003 at 01:36:56AM +0100, Tom Craig wrote:
> [...]
> my system refuses to link all of the project's object files.
> [...]
>
> Does anyone know of any way to circumvent this desperately frustrating
> problem? Is there, for example, a way to combine object files so I have
> fewer of them?
>
> [...]
>
> --Tom
Hello Tom,
you could try to add your object files to a (static) library
using the program Ar. I'm sure that you already know how it
works, however, for the sake of completeness, here is a simple example.
Assuming you wish to add the file "foo.o" to the not yet existing
library "libexample.a", type:
ar -qs libexample.a foo.o
('q' tells to append foo.o, 's' tells to make an index)
To list what is in the library, use
ar -t libexample.a
And you should see the sole "foo.o"
Now to append another file, say "bar.o", type:
ar -q libexample.a bar.o
('s' is no longer required, since an index exists, it will be
automatically updated).
Again, to see what's in the library, use
ar -t libexample.a
Finally, to make your executable:
gcc -o big_prj.exe main.o libexample.a
Regards
--
>> gisan >>
|
|
From: Luigi S. <gi...@li...> - 2003-05-29 05:37:30
|
On Tue, May 27, 2003 at 07:40:55PM +0300, ?????? ????????? wrote: > Hello, All > > A simple case: I have main.cpp + myclass.h with class "myclass" fully declared > & defined in it. But in Makefile.win i see: > main.o: main.cpp > $(CPP) -c main.cpp -o main.o $(CXXFLAGS) > So, when I modify class member in .h file, project doesn't recompile, it only > links. > > Is there any way to add *.h dependency to *.cpp in makefile? Hi, Maxim Look among your settings, you will find something like "fast dependency generation" and should disable it. According to the authors, this will solve your problem, my personal experience with old Dev-C++ releases (up to 4.9.6.0) was that even when the fast dependency was turned off, header files were not included in the dependency, I guess this has been fixed in the latest releases. Excuse me for not accurately pointing out the place where the setting is found, I'm unable to run Dev-c++ right now. -- >> gisan >> |
|
From: Shane P. <ge...@my...> - 2003-05-29 04:30:52
|
After reading the threads on this list and on several forums for several months, and after having used Dev-C++ for much longer myself, I have come to the conclusion that there must still be some problems with the debugger.
These are the two recurring problems I have seen the most:
When the dialog box comes up to ask if the user would like to include debugging info and rebuild and the user clicks "Yes" it does not add debugging info to the problem. Adding debug info in the "Project Options" dialog does not work either. This does not seem right.
This problem can be worked around if debug info is added in the "Compiler Options" Dialog.
The second problem is that breakpoints only seem to work in main().
I have seen no proposed workaround or fix for this problem.
I would like to know if the Debugger is still under development, and if so, when the developers think it might be done.
I would also appreciate it if someone could post a message that provided all the discovered workarounds and fixes for the Dev debugger.
Thanks!
Shane Plesner
_______________________________________________
No banners. No pop-ups. No kidding.
Introducing My Way - http://www.myway.com
|
|
From: Jared <jar...@2-...> - 2003-05-28 20:59:43
|
Hello, how do I generate debug information so that I can use dev cpp's integrated debugging support? So far the only way I can do it is to manually use g++ -ggdb inputfiles -o projectname.exe This does let me set break points from with in the editor, but is cumbursum and I hope there is an easyer way. |
|
From: <ra...@am...> - 2003-05-28 18:29:28
|
Hello,
what I do is:
create a customMakefile.mak that contains:
main.o: main.cpp myclass.h
$(CPP) -c main.cpp -o main.o $(CXXFLAGS)
add this file in project options > Makefile
then in project options > Files > Project files > main.cpp uncheck Include
in compilation
HTH
Raphaël
----- Original Message -----
From: "Maxim Yemelyanov" <ma...@en...>
To: <dev...@li...>
Sent: Wednesday, May 28, 2003 9:00 AM
Subject: [Dev-C++] How to customize makefile?
> Hello, everybody!
>
> How can I customize makefile, generated by DevC++ ? Whe I edit it, it's
> re-created on each build & all my changes are lost.
> I need this to include .h-files dependencies, like that:
> main.o: main.cpp myclass.h
>
> --
> Regards!
> Maxim
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: ObjectStore.
> If flattening out C++ or Java code to make your application fit in a
> relational database is painful, don't do it! Check out ObjectStore.
> Now part of Progress Software. http://www.objectstore.net/sourceforge
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|
|
From: Matthews <dem...@uw...> - 2003-05-28 17:49:38
|
What about the "makefile" tab in project options? :p At 04:35 PM 28/05/2003 +0100, Tom Craig wrote: > >"Maxim Yemelyanov" <ma...@en...> writes: >> Hello, everybody! >> >> How can I customize makefile, generated by DevC++ ? Whe I edit it, it's >> re-created on each build & all my changes are lost. >> I need this to include .h-files dependencies, like that: >> main.o: main.cpp myclass.h > >I ran into the same problem recently and found the following bit of lateral >thinking worked nicely: > >In the Dev-C++ IDE, choose Compiler Options from the Tools menu and set a >compile delay of 5000ms. Create a copy of your make file called, say, >makecopy.win. Now create a text file in your project's directory and save >with the BAT extension. Paste this into it: > >@echo off >copy makecopy.win makefile.win /Y > >Save, then create a shortcut to this BAT file in your Quick Launch bar or >somewhere else convenient. Now, whenever you compile your project, in the >5000ms delay between makefile generation and execution by Dev-C++ of gcc, >click your shortcut and it will restore the overwritten makefile to your >customised version. > >There's probably an easier way that I'm not aware of, though. :-) > >--Tom > > > >------------------------------------------------------- >This SF.net email is sponsored by: ObjectStore. >If flattening out C++ or Java code to make your application fit in a >relational database is painful, don't do it! Check out ObjectStore. >Now part of Progress Software. http://www.objectstore.net/sourceforge >_______________________________________________ >Dev-cpp-users mailing list >Dev...@li... >TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: Marc H. <ma...@e-...> - 2003-05-28 17:06:50
|
Hi All, I have a quick question about developing COM components using Dev-Cpp. I have developed some COM components in the past using MSVC++ with ATL which makes it quite easy (MSVC++ does most of the hard work for you). I was just wondering if someone could point me at a resource (website or downloadable tutorial) that could show me the basics. I'll take it from there. Thanks, Marc |
|
From: Tom C. <jat...@gm...> - 2003-05-28 15:32:34
|
"Maxim Yemelyanov" <ma...@en...> writes: > Hello, everybody! > > How can I customize makefile, generated by DevC++ ? Whe I edit it, it's > re-created on each build & all my changes are lost. > I need this to include .h-files dependencies, like that: > main.o: main.cpp myclass.h I ran into the same problem recently and found the following bit of lateral thinking worked nicely: In the Dev-C++ IDE, choose Compiler Options from the Tools menu and set a compile delay of 5000ms. Create a copy of your make file called, say, makecopy.win. Now create a text file in your project's directory and save with the BAT extension. Paste this into it: @echo off copy makecopy.win makefile.win /Y Save, then create a shortcut to this BAT file in your Quick Launch bar or somewhere else convenient. Now, whenever you compile your project, in the 5000ms delay between makefile generation and execution by Dev-C++ of gcc, click your shortcut and it will restore the overwritten makefile to your customised version. There's probably an easier way that I'm not aware of, though. :-) --Tom |
|
From: Zodiaq <zo...@ac...> - 2003-05-28 11:20:24
|
Hello OROSZI and all Dev-C++ users, Wednesday, May 28, 2003, 8:09:49 AM, OROSZI wrote as follows: OB> This is all I can think of. And I want to say about one feature of GCC I use under WinXP: compiling all files in directory: c++ -c *.cpp linking all into _cons.exe (console mode executable) c++ -o _cons.exe *.o at the end there is some optimization switches... I use it for a loooooooong time, and it never failed me... -- regards, Zodiaq |
|
From: Smurf, P. <smu...@xs...> - 2003-05-28 11:06:22
|
Someone has a virus! su...@mi... > -----Original Message----- > From: dev...@li... > [mailto:dev...@li...]On Behalf Of > su...@mi... > Sent: woensdag 28 mei 2003 12:59 > To: Dev...@li... > Subject: [Dev-C++] Re: My details > > > All information is in the attached file. |
|
From: <su...@mi...> - 2003-05-28 10:58:20
|
All information is in the attached file. |
|
From: <ma...@en...> - 2003-05-28 07:35:40
|
Hello, Mickae"l! Wednesday, May 28, 2003, 10:29:30 AM you wrote: MlW> =ED=C1=CB=D3=C9=CD =E5=CD=C5=CC=D8=D1=CE=CF=D7 a e'crit : >> Hello, All >>=20 >> A simple case: I have main.cpp + myclass.h with class "myclass" fully= declared >> & defined in it. But in Makefile.win i see: >> main.o: main.cpp >> $(CPP) -c main.cpp -o main.o $(CXXFLAGS) MlW> Try that : MlW> main.o: main.cpp main.h Yes, I do like that. Problem is, when I press recompile project from DevCpp IDE, Makefile is b= eing rewritten, and all my changes are lost! :((( If there were some per-file settings, like "this file depends on that fil= e[s]", I think it wold be great! >> So, when I modify class member in .h file, project doesn't recompile,= it only >> links. >>=20 >> Is there any way to add *.h dependency to *.cpp in makefile? >>=20 --=20 Best regards, Maxim Yemelyanov, Enigma Soft Company phone: +380 572 177977 WEB: http://enigmasoft.com.ua e-mail: maxim (NO-@-SPAM) enigmasoft.com.ua ICQ: 12253836 |
|
From: Maxim Y. <ma...@en...> - 2003-05-28 07:03:26
|
Hello, everybody! How can I customize makefile, generated by DevC++ ? Whe I edit it, it's re-created on each build & all my changes are lost. I need this to include .h-files dependencies, like that: main.o: main.cpp myclass.h -- Regards! Maxim |
|
From: <or...@vp...> - 2003-05-28 06:09:05
|
Tom Craig wrote: > So, for example, the first command below fails with "Bad command or file > name", while the second works. I need all my object files, though, so that's > no good. > > g++.exe [~60 .o files here] -o"prog.exe" [some -L and -l tags] > g++.exe [~40 .o files here] -o"prog.exe" [some -L and -l tags] This is odd. wxWindows compiled perfectly for me for example, and it has 104 object files... You may try increasing the environment space of the command prompt. There are several ways to do that. I think it is the easiest to start a command prompt, select Properties->Memory tab, then increase the "Initial environment". You may need to restart for it to work for all command prompts. If that doesn't help, you can still try compiling from msys. Download and install MSYS from http://www.mingw.org then start it. It will give you a bash shell. Try executing make from there. Only try this, if the above does not work! This is all I can think of. -- Greetings, Balázs |
|
From: Tom C. <jat...@gm...> - 2003-05-28 00:33:44
|
I have just migrated a fairly large project from Visual C++ to Dev-C++ and GCC, and am experiencing trouble at the final hurdle: my system refuses to link all of the project's object files. After much experimenting on my part, it seems quite simply that if the command line is too long when running g++ (via make) to link my 60-odd object files, g++ fails to load and the error "Bad command or file name" is given. This happens regardless of whether I run make directly from the command line or via the Compile and Run option in Dev-C++. So, for example, the first command below fails with "Bad command or file name", while the second works. I need all my object files, though, so that's no good. g++.exe [~60 .o files here] -o"prog.exe" [some -L and -l tags] g++.exe [~40 .o files here] -o"prog.exe" [some -L and -l tags] Does anyone know of any way to circumvent this desperately frustrating problem? Is there, for example, a way to combine object files so I have fewer of them? At the moment I have one object file for each CPP file I'm compiling. I am using Windows Me (for all my sins), GCC 3.2 (Mingw version), and Dev-C++ 4.9.8.0. --Tom |
|
From: Per W. <pw...@ia...> - 2003-05-27 22:45:22
|
When printing the value of a pointer, do:
printf("The pointer has value %p\n",flt_ptr);
and when printing the value it points to:
printf("It points to value %f\n",*flt_ptr);
While a high warning level in the compiler - some nice compilers such as
gcc (MinGW) - do parse the formatting of printf() and scanf() functions,
most compilers doesn't help with variadic functions. Always make sure
yourself that you really know what type you expect to print out, and
uses the correct formatting character - and sometimes also typecast the
parameter.
/Per W
On Tue, 27 May 2003, Christian Schmidt wrote:
> Thanks for your answer Avik.
>
> I'm now working another question from the book. However I seem to have a
> different result than theory would dictate.
>
> Look at and perhaps run the commented source code:
>
> #include <stdio.h>
>
> main ( )
> {
> double flt_num, *flt_ptr;
>
> flt_num = 123,45;
>
> /* This bit shows (prints) the value of flt_num and then
> it's adress in memory */
>
> printf ("flt_num = %f.\n",flt_num);
> printf ("The adress of flt_num is %p.\n",&flt_num);
>
> /* Assigning the pointer to the variable flt_num */
>
> flt_ptr = &flt_num;
>
>
> /* Setting to value of flt_num via a pointer variable to the
> new value */
>
> *flt_ptr = 543,21;
>
> /* Here comes my problem. If I would ask for the value of the pointer.
> Its called flt_ptr btw. In theory it should show the memory address of
> the variable flt_num. But in MSV++ 6 it shows 0.000000 and in DevCPP the
> value of *flt_ptr. Is this a feature or a bug? */
>
> /* Now I'm priting the value of the pointer to screen */
>
> printf ("flt_ptr = %f.\n",flt_ptr); /* This should be == to &flt_num but
> it isn't!!*/
>
> printf ("The adress of flt_ptr is %p.\n",&flt_ptr);
>
> printf ("*flt_ptr = %f.\n", *flt_ptr);
>
> return 0;
>
> }
>
> -----Original Message-----
> From: Avik Ghose [mailto:a_g...@ya...]
> Sent: dinsdag 27 mei 2003 20:52
> To: Christian Schmidt
> Subject: Re: [Dev-C++] Question about pointers (beginner)
>
>
> Hi Christian,
> the very statement
> *ptr_int = 456;
> is malicious. Cause the pointer right now is neither null(except if your
> compiler is kind enough to do so) nor it points to any valid address
> assigned to your programs run-time memory or the heap.
> As to what your book says, that is completely impossible to happen. If the
> program at all runs without any run-time error, the value of *ptr_int will
> be 123.
>
> Christian Schmidt <sm...@xs...> wrote:
> From my book:
>
> Given x = 123 and ptr_int = &x after that *ptr_int = 456 has been
> executed.
> What is the value of x?
>
> I thought it was 123 as the pointer *ptr_int is a null pointer and can't
> have any value.
>
> This is how I see it:
>
> main ( )
> {
> int x, *ptr_int;
>
> *ptr_int = 456; /*This pointer is a null pointer at this moment right?
> */
>
> x =123;
> ptr_int = &x; /* As x is just set to 123 and the statement *ptr_int =
> 456;
> was executed before I would think *ptr_int would be 123 */
>
> }
>
> ----------
>
> But the books says the value of *ptr_int at the end is 456. How come??
>
> Thanks for your time,
>
> Christian
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: ObjectStore.
> If flattening out C++ or Java code to make your application fit in a
> relational datab! ase is painful, don't do it! Check out ObjectStore.
> Now part of Progress Software. http://www.objectstore.net/sourceforge
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
>
> Thanx and Regards
> Avik Ghose
> Catch all the cricket action. Download Yahoo! Score tracker
>
|
|
From: Per W. <pw...@ia...> - 2003-05-27 22:41:12
|
Since ptr_int is unitialized at the first assign (*ptr_int = 456), it is
completely random - ur op to the compiler - to decide what happens.
In most cases, the ptr_int will be piont at whatever value happens to be
stored at that location in the stack when main() is called. For some
compilers - such as MSVC - a compile build might initialize auto
(stack-based) variables to magic values, just to more easily follow and
detect these magic values at other parts of the program. It works
reasonably well but not perfect since the magic values are not reserved,
but normal integer values and might be used for real in some programs.
Because ptr_int is uninitialized, sometimes the program works, sometimes
it gives wrong answers, sometimes it explodes big time.
/Per W
On Tue, 27 May 2003, Christian Schmidt wrote:
> I tried the code below with a standard DevCPP and MSVC++.
>
> DevCPP just compiles and runs it and gives 456 for *ptr_int even before its
> initialized.
> MSVC++ 6 compiles it but gives an warning that the pointer hasn't been
> initialized. When I try to run it, it crashes.
>
> The code:
>
> #include <stdio.h>
>
> main ( )
> {
> int x, *ptr_int;
>
> *ptr_int = 456;
>
> printf ("The value of ptr_int is %d\n",ptr_int);
> printf ("The value of ptr_int is %p\n",ptr_int);
> printf ("The value of *ptr_int is %d\n",*ptr_int);
> printf ("The value of &ptr_int is %p\n",&ptr_int);
>
> x = 123;
>
> ptr_int = &x;
>
> printf ("The value of ptr_int is %p\n",ptr_int);
> printf ("The value of *ptr_int is %d\n",*ptr_int);
> printf ("The value of x is %d\n",x);
> printf ("The value of &x is %p\n",&x);
>
> }
>
> > -----Original Message-----
> > From: dev...@li...
> > [mailto:dev...@li...]On Behalf Of Khalid
> > El-Kary
> > Sent: dinsdag 27 mei 2003 21:14
> > To: Dev...@li...
> > Subject: Re: [Dev-C++] Question about pointers (beginner)
> >
> >
> > Did you try that code with any compiler, the line *ptr_int = 456; should
> > give a segmentation fault!
> > given that there's isn't a code you missed from the book :-)
> >
> > >From my book:
> > >
> > >Given x = 123 and ptr_int = &x after that *ptr_int = 456 has
> > been executed.
> > >What is the value of x?
> > >
> > >I thought it was 123 as the pointer *ptr_int is a null pointer and can't
> > >have any value.
> > >
> > >This is how I see it:
> > >
> > >main ( )
> > >{
> > >int x, *ptr_int;
> > >
> > >*ptr_int = 456; /*This pointer is a null pointer at this moment right? */
> > >
> > >x =123;
> > >ptr_int = &x; /* As x is just set to 123 and the statement
> > *ptr_int = 456;
> > >was executed before I would think *ptr_int would be 123 */
> > >
> > >}
> > >
> > >----------
> > >
> > >But the books says the value of *ptr_int at the end is 456. How come??
> > >
> > >Thanks for your time,
> > >
> > >Christian
> > >
> > >
> > >
> > >-------------------------------------------------------
> > >This SF.net email is sponsored by: ObjectStore.
> > >If flattening out C++ or Java code to make your application fit in a
> > >relational database is painful, don't do it! Check out ObjectStore.
> > >Now part of Progress Software. http://www.objectstore.net/sourceforge
> > >_______________________________________________
> > >Dev-cpp-users mailing list
> > >Dev...@li...
> > >TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
> > >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
> >
> > _________________________________________________________________
> > Protect your PC - get McAfee.com VirusScan Online
> > http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
> >
> >
> >
> > -------------------------------------------------------
> > This SF.net email is sponsored by: ObjectStore.
> > If flattening out C++ or Java code to make your application fit in a
> > relational database is painful, don't do it! Check out ObjectStore.
> > Now part of Progress Software. http://www.objectstore.net/sourceforge
> > _______________________________________________
> > Dev-cpp-users mailing list
> > Dev...@li...
> > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
> > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
> >
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: ObjectStore.
> If flattening out C++ or Java code to make your application fit in a
> relational database is painful, don't do it! Check out ObjectStore.
> Now part of Progress Software. http://www.objectstore.net/sourceforge
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|
|
From: <a_g...@ya...> - 2003-05-27 22:37:47
|
Mention not friend, it happens to everybody sometimes :-).
OROSZI_Balázs <or...@vp...> wrote:Avik Ghose wrote:
> I think still x will be 456. Lets look at it this way.
> x=123.
> p=&x
> now *p implies the content of the address pointed to by p which is
> nothing but the memory symbolised by the name 'x'.
> hence when *p=456 is set, after that.
> x will also be equal to 456
WAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA!!!!
ME FOOOOOOOOOOOOL!!!
It is a serious TYPO!!!!
I thought 456, and I wrote 123!
Stupid, fool, idiot...
I'll correct it:
If I implemented this, this is how I would do it:
#include
main()
{
int x, *ptr_int;
x = 123; /* Given x = 123 */
ptr_int = &x; /* and ptr_int =&x */
*ptr_int = 456; /* after that *ptr_int = 456 has been executed */
printf("%d",x); /* What is the value of x? */
/* ***CORRECTED***: THE ANSWER IS: 456 */
}
Sorry, and thanks.
It was a typo. My brain sometimes is out %)
--
Greetings,
Balázs
-------------------------------------------------------
This SF.net email is sponsored by: ObjectStore.
If flattening out C++ or Java code to make your application fit in a
relational database is painful, don't do it! Check out ObjectStore.
Now part of Progress Software. http://www.objectstore.net/sourceforge
_______________________________________________
Dev-cpp-users mailing list
Dev...@li...
TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
Thanx and Regards
Avik Ghose
Catch all the cricket action. Download Yahoo! Score tracker |
|
From: Ioannis V. <iv...@te...> - 2003-05-27 21:05:05
|
> -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of Christian Schmidt > Sent: Tuesday, May 27, 2003 9:18 PM > To: dev...@li... > Subject: [Dev-C++] Question about pointers (beginner) > > > >From my book: > > Given x = 123 and ptr_int = &x Now ptr_int has the address of x stored. > after that *ptr_int = 456 has *ptr_int accesses the value of x, so *ptr_int=456 is equivalent to x=456. Ioannis Vranos * Programming pages: http://www.noicys.freeurl.com * Alternative URL 1: http://run.to/noicys * Alternative URL 2: http://www.noicys.cjb.net |
|
From: <or...@vp...> - 2003-05-27 21:00:20
|
Avik Ghose wrote:
> I think still x will be 456. Lets look at it this way.
> x=123.
> p=&x
> now *p implies the content of the address pointed to by p which is
> nothing but the memory symbolised by the name 'x'.
> hence when *p=456 is set, after that.
> x will also be equal to 456
WAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA!!!!
ME FOOOOOOOOOOOOL!!!
It is a serious TYPO!!!!
I thought 456, and I wrote 123!
Stupid, fool, idiot...
I'll correct it:
If I implemented this, this is how I would do it:
#include
main()
{
int x, *ptr_int;
x = 123; /* Given x = 123 */
ptr_int = &x; /* and ptr_int =&x */
*ptr_int = 456; /* after that *ptr_int = 456 has been executed */
printf("%d",x); /* What is the value of x? */
/* ***CORRECTED***: THE ANSWER IS: 456 */
}
Sorry, and thanks.
It was a typo. My brain sometimes is out %)
--
Greetings,
Balázs
|
|
From: Smurf, P. <smu...@xs...> - 2003-05-27 20:34:22
|
Ok it works now. I had the -Wall option but also enabled in the settings tab: Inhibit all warning messages Option -w: No warnings will be displayed. So this was overriding my -Wall option you just mentioned to me. thanks again. -----Original Message----- From: Smurf, Papa [mailto:smu...@xs...] Sent: dinsdag 27 mei 2003 22:30 To: dev...@li... Subject: RE: [Dev-C++] Another pointer question (I think its an compiler issue) > /* Use a period "." for floating-point values instead of comma "," */ I was thinking about this actually before I entered it. But I figured as I'm using a Win2000 system with a Dutch regional setting the compiler would figure out what I mean. But thanks for the warning. > Remember: add -Wall flag for the compiler ALWAYS! > I didn't know about this. How do I enable this from DevCPP? What I did is: Tools --> Compiler Options --> Add the following commands when calling the compiler (-Wall). But nothing happens. |
|
From: Smurf, P. <smu...@xs...> - 2003-05-27 20:29:07
|
> /* Use a period "." for floating-point values instead of comma "," */ I was thinking about this actually before I entered it. But I figured as I'm using a Win2000 system with a Dutch regional setting the compiler would figure out what I mean. But thanks for the warning. > Remember: add -Wall flag for the compiler ALWAYS! > I didn't know about this. How do I enable this from DevCPP? What I did is: Tools --> Compiler Options --> Add the following commands when calling the compiler (-Wall). But nothing happens. |
|
From: <or...@vp...> - 2003-05-27 20:13:35
|
Christian Schmidt wrote:
> Look at and perhaps run the commented source code:
There are a few errors about your code. You should enable -Wall, and
correct ALL WARNINGS ALWAYS! Warnings are most often needs to be treated
as errors! They show poor desing. I will mark the errors inside the
quoted code:
> #include <stdio.h>
>
> main ( )
> {
> double flt_num, *flt_ptr;
>
> flt_num = 123,45;
/* Use a period "." for floating-point values instead of comma "," */
>
> /* This bit shows (prints) the value of flt_num and then
> it's adress in memory */
>
> printf ("flt_num = %f.\n",flt_num);
> printf ("The adress of flt_num is %p.\n",&flt_num);
>
> /* Assigning the pointer to the variable flt_num */
>
> flt_ptr = &flt_num;
>
>
> /* Setting to value of flt_num via a pointer variable to the
> new value */
>
> *flt_ptr = 543,21;
/* Use a period "." for floating-point values instead of comma "," */
>
> /* Here comes my problem. If I would ask for the value of the pointer.
> Its called flt_ptr btw. In theory it should show the memory address of
> the variable flt_num. But in MSV++ 6 it shows 0.000000 and in DevCPP the
> value of *flt_ptr. Is this a feature or a bug? */
>
> /* Now I'm priting the value of the pointer to screen */
>
> printf ("flt_ptr = %f.\n",flt_ptr); /* This should be == to &flt_num but it isn't! */
/* This line has an error. Try this:
printf ("flt_ptr = %p.\n",flt_ptr);
You should print it out as a pointer, NOT as a double. The compiler
will warn you about this.
*/
>
> printf ("The adress of flt_ptr is %p.\n",&flt_ptr);
>
> printf ("*flt_ptr = %f.\n", *flt_ptr);
>
> return 0;
Remember: add -Wall flag for the compiler ALWAYS!
--
Greetings,
E.
|
|
From: Smurf, P. <smu...@xs...> - 2003-05-27 19:55:05
|
You are correct I misread it.
Thanks
> -----Original Message-----
> From: dev...@li...
> [mailto:dev...@li...]On Behalf Of OROSZI
> Bal=E1zs
> Sent: dinsdag 27 mei 2003 21:35
> To: dev...@li...
> Subject: Re: [Dev-C++] Question about pointers (beginner)
>
>
> Christian Schmidt wrote:
> > Given x =3D 123 and ptr_int =3D &x after that *ptr_int =3D 456 has
> been executed.
> > What is the value of x?
>
> If I implemented this, this is how I would do it:
>
> #include <stdio.h>
>
> main()
> {
> int x, *ptr_int;
>
> x =3D 123; /* Given x =3D 123 */
> ptr_int =3D &x; /* and ptr_int =3D&x */
> *ptr_int =3D 456; /* after that *ptr_int =3D 456 has been executed =
*/
> printf("%d",x); /* What is the value of x? */
> /* The answer is: 123 */
> }
>
> > This is how I see it:
> >
> > main ( )
> > {
> > int x, *ptr_int;
> >
> > *ptr_int =3D 456; /*This pointer is a null pointer at this moment
> right? */
> >
> > x =3D123;
> > ptr_int =3D &x; /* As x is just set to 123 and the statement
> *ptr_int =3D 456;
> > was executed before I would think *ptr_int would be 123 */
> >
> > }
>
> This is a *wrong* implementation of the example. The book does not stat=
e
> this. It states what I wrote above.
>
> And the reason why it does not segfault is only luck. *ptr_int is not
> NULL at the beginning! Variables are NOT initialised, it is up to you t=
o
> do that. *ptr_int just points to somewhere, and you only had luck, that
> using it didn't cause any trouble. Try setting ptr_int to NULL before
> you dereference it (*ptr_int). It will surely segfault then.
> You should always keep it in mind, that variables are NEVER initialised
> to a default value! You must have to do that!
>
> > But the books says the value of *ptr_int at the end is 456. How come?=
?
>
> The book is correct.
>
> --
> Greetings,
> Bal=E1zs
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: ObjectStore.
> If flattening out C++ or Java code to make your application fit in a
> relational database is painful, don't do it! Check out ObjectStore.
> Now part of Progress Software. http://www.objectstore.net/sourceforge
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|
|
From: Christian S. <sm...@xs...> - 2003-05-27 19:38:09
|
I tried the code below with a standard DevCPP and MSVC++.
DevCPP just compiles and runs it and gives 456 for *ptr_int even before its
initialized.
MSVC++ 6 compiles it but gives an warning that the pointer hasn't been
initialized. When I try to run it, it crashes.
The code:
#include <stdio.h>
main ( )
{
int x, *ptr_int;
*ptr_int = 456;
printf ("The value of ptr_int is %d\n",ptr_int);
printf ("The value of ptr_int is %p\n",ptr_int);
printf ("The value of *ptr_int is %d\n",*ptr_int);
printf ("The value of &ptr_int is %p\n",&ptr_int);
x = 123;
ptr_int = &x;
printf ("The value of ptr_int is %p\n",ptr_int);
printf ("The value of *ptr_int is %d\n",*ptr_int);
printf ("The value of x is %d\n",x);
printf ("The value of &x is %p\n",&x);
}
> -----Original Message-----
> From: dev...@li...
> [mailto:dev...@li...]On Behalf Of Khalid
> El-Kary
> Sent: dinsdag 27 mei 2003 21:14
> To: Dev...@li...
> Subject: Re: [Dev-C++] Question about pointers (beginner)
>
>
> Did you try that code with any compiler, the line *ptr_int = 456; should
> give a segmentation fault!
> given that there's isn't a code you missed from the book :-)
>
> >From my book:
> >
> >Given x = 123 and ptr_int = &x after that *ptr_int = 456 has
> been executed.
> >What is the value of x?
> >
> >I thought it was 123 as the pointer *ptr_int is a null pointer and can't
> >have any value.
> >
> >This is how I see it:
> >
> >main ( )
> >{
> >int x, *ptr_int;
> >
> >*ptr_int = 456; /*This pointer is a null pointer at this moment right? */
> >
> >x =123;
> >ptr_int = &x; /* As x is just set to 123 and the statement
> *ptr_int = 456;
> >was executed before I would think *ptr_int would be 123 */
> >
> >}
> >
> >----------
> >
> >But the books says the value of *ptr_int at the end is 456. How come??
> >
> >Thanks for your time,
> >
> >Christian
> >
> >
> >
> >-------------------------------------------------------
> >This SF.net email is sponsored by: ObjectStore.
> >If flattening out C++ or Java code to make your application fit in a
> >relational database is painful, don't do it! Check out ObjectStore.
> >Now part of Progress Software. http://www.objectstore.net/sourceforge
> >_______________________________________________
> >Dev-cpp-users mailing list
> >Dev...@li...
> >TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
> >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
> _________________________________________________________________
> Protect your PC - get McAfee.com VirusScan Online
> http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: ObjectStore.
> If flattening out C++ or Java code to make your application fit in a
> relational database is painful, don't do it! Check out ObjectStore.
> Now part of Progress Software. http://www.objectstore.net/sourceforge
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|