dev-cpp-users Mailing List for Dev-C++
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
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
|
|
|
1
(19) |
2
(22) |
3
(9) |
4
(15) |
5
(17) |
6
(17) |
7
(33) |
8
(18) |
9
(15) |
10
(11) |
11
(12) |
12
(8) |
13
(9) |
14
(11) |
15
(5) |
16
(9) |
17
(8) |
18
(9) |
19
(9) |
20
(2) |
21
(13) |
22
(4) |
23
(5) |
24
(6) |
25
(6) |
26
(12) |
27
(9) |
28
(16) |
29
(14) |
30
(7) |
31
(7) |
From: <Ech...@ne...> - 2002-08-31 21:17:55
|
What is the format of .DevPak files, and how does one create them? I have been interested in creating packages for devcpp but have not been able to find any documentation on how to do so. Thanks, Evan __________________________________________________________________ The NEW Netscape 7.0 browser is now available. Upgrade now! http://channels.netscape.com/ns/browsers/download.jsp Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/ |
From: Elizabeth B. <sog...@ya...> - 2002-08-31 19:51:03
|
vinay kumar <vch...@ya...> writes: > Hello All, > > The following program copies the content of the file > on to cout. > > ifstream ifile ("example_file"); > copy (istream_iterator <int, ptrdiff_t> (ifile), > istream_iterator<int, ptrdiff_t> (), > ostream_iterator<int> (cout) ); > > could some one tell me how this program works? > > Regards > Vinay. You might be interested in Eckel's two books, Thinking in C++ volumes I and II, especially II which address iterators although the whole book is not yet complete: Free versions are on the web at: <http://www.bruceeckel.com/> Analysis follows: For information on the copy() function: <http://wwwinfo.cern.ch/asd/lhc++/RW/stdlibcr/cop_4514.htm> Apparently, copy just begins at one iterator and pumps each iteration to the output iterator and both are increased. We then need to look closer at the iostream iterators: In <http://geneura.ugr.es/~gustavo/stl/istream_iterator.html> we see the beginning of the definition of istream_iterator as: template <class T, class Distance = ptrdiff_t> class istream_iterator { ... } And ostream_iterator: template <class T> class ostream_iterator { ... } from: <http://geneura.ugr.es/~gustavo/stl/ostream_iterator.html> So, I'd say that an iterator is made from ifile, and each iteration is pumped to ostream with each subsequent iterator checked against the same type of istream that did not have a istream passed into it's constructor. As to how copy realizes that it's at the end of the file, though, I do not know because it is just checking that it's not equal to the standard constructor's istream iterator which defaults to standard input when an istream is not passed into the constructor. It may be that this is a special propery of istream_iterator. Elizabeth |
From: Ioannis V. <no...@ho...> - 2002-08-31 16:59:22
|
The resulting source code after the preprocessing is where in the source code was written PI to have been replaced with 3.1415 and where TWOPI is written to have been replaced with (2.0 * 3.1415). Then the whole code gets compiled. Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.cjb.net <http://www.noicys.cjb.net/> * Alternative URL: http://run.to/noicys -----Original Message----- From: dev...@li... [mailto:dev...@li...] On Behalf Of Scott Williams Sent: Saturday, August 31, 2002 6:05 PM To: dev...@li... Subject: [Dev-C++] Simple Question Hi, This is more of a general C question but just in case it's compiler dependent. . . I'm curious how the following is handled: #define PI 3.1415 #define TWOPI (2.0 * PI) Does this add a flop everywhere TWOPI is used or is the expression evaluated to 6.2830 and then inserted? If the latter, with what precision is the evaluation done (e.g., what does TWOPI look like if I #define PI to 20 digits?). Thanks. Scott |
From: vinay k. <vch...@ya...> - 2002-08-31 15:45:04
|
Hello All, The following program copies the content of the file on to cout. ifstream ifile ("example_file"); copy (istream_iterator <int, ptrdiff_t> (ifile), istream_iterator<int, ptrdiff_t> (), ostream_iterator<int> (cout) ); could some one tell me how this program works? Regards Vinay. __________________________________________________ Do You Yahoo!? Yahoo! Finance - Get real-time stock quotes http://finance.yahoo.com |
From: Scott W. <se...@al...> - 2002-08-31 15:05:10
|
Hi, =20 This is more of a general C question but just in case it=92s compiler = dependent. . . =20 I=92m curious how the following is handled: =20 #define PI 3.1415 #define TWOPI (2.0 * PI) =20 Does this add a flop everywhere TWOPI is used or is the expression = evaluated to 6.2830 and then inserted? If the latter, with what = precision is the evaluation done (e.g., what does TWOPI look like if I = #define PI to 20 digits?). =20 Thanks. =20 Scott =20 |
From: Abhijit S. <mu...@gm...> - 2002-08-31 11:36:36
|
> > Is There ANY Way To Put In Graphics AND/OR Sound In A DOS Application??? > > Please, Tell How, In Detail, Cause Im Very New At Programming... > > Garrett B. > > > > Email: Jed...@ms... > > Try the Allegro library. It does sound, graphics, timing, etc. It's meant > mainly for games, but there's nothing stopping you from using it for writing > programs. It's also very portable (to Linux, Windows, DOS, Solaris, etc.). Oh, right... URL... http://www.allegro.cc or something. What, you aren't telepathic? ___________________________________________________________ Abhijit Shylanath E-mail: mu...@gm... || ibr...@bi... Web-site: http://mudeth.tripod.com/ |
From: Ouroborus <our...@so...> - 2002-08-31 04:53:17
|
Now that cheaters in the game are mostly dealt with (and we've got plans on how to further drive them to extinction) the next major issue to deal with is whiners. Mostly this has to do with the forum at blacknova.net. I believe we should put something in the header stating that we have a zero tolerance for whining and that if you must give critisism, it must be constructive or done privately. Further, a zero tolerance policy on flames should be taken. If members cannot control thier language and tempers then they will be deamed not mature enough to participate in those forums. Once posted, give it a few days and then start deleting forum accounts that ignore these policies. |
From: <Met...@ao...> - 2002-08-30 14:24:42
|
I'm working on W98SE since ever and I've never seen this problem occur on my machine. And I compile some projects with 200+ lines resources files. Really don't understand what's happening. Perhaps you could ask Colin. -- Seb |
From: <al...@te...> - 2002-08-30 11:46:08
|
Finaly i have found the problem, it was mi AntiVirus monitor (Cheyenne), i.ve turn it off, next compile any thing with Dev-cpp and IT WORKS!!! Don=B4t ask me the reason...i am very happy that Windres.exe works again. Thank=B4s and sorry for bothering all of you.... ----- Original Message ----- From: <al...@te...> To: <dev...@li...> Sent: Friday, August 30, 2002 1:31 PM Subject: Re: [Dev-C++] trouble with windres.exe After reinstalling Win98 over it self (just toke me 3 hours!!!) windes.ex= e worked only one time, the second time i tried to compile i,ve got the message: "windres.exe: no resources" it woun=B4t work again... ----- Original Message ----- From: "Zendar" <ze...@ne...> Sent: Friday, August 30, 2002 6:30 AM Subject: [Dev-C++] trouble with windres.exe > >FROM: teleline.es > >DATE: 08/29/2002 06:03:13 > >SUBJECT: [Dev-C++] trouble with windres.exe > > > > >Sudently i can use resources file.... > > >Allway the same answer, with all the programs i have tried to compile that > >have resources files: > >message is: "windres.exe: no resources" > > >I've reinstall Dev-C++ 5.0 beta 5 (4.9.5.0) three or four times and i can=B4t > >compile anythig whit resources, not even the simples examples that com= e with > >it. > > >I am using win98. > > >don=B4t understand anything.. > > I am using Windows 98 also and I see this same error.. > It does not occur on my NT box. > Seems it is realated to Windows 98 > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > 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: OSDN - Tired of that same old cell phone? Get a new here for FREE! https://www.inphonic.com/r.asp?r=3Durceforge1&refcode1=3D3390 _______________________________________________ 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: <al...@te...> - 2002-08-30 11:31:13
|
After reinstalling Win98 over it self (just toke me 3 hours!!!) windes.ex= e worked only one time, the second time i tried to compile i,ve got the message: "windres.exe: no resources" it woun=B4t work again... ----- Original Message ----- From: "Zendar" <ze...@ne...> Sent: Friday, August 30, 2002 6:30 AM Subject: [Dev-C++] trouble with windres.exe > >FROM: teleline.es > >DATE: 08/29/2002 06:03:13 > >SUBJECT: [Dev-C++] trouble with windres.exe > > > > >Sudently i can use resources file.... > > >Allway the same answer, with all the programs i have tried to compile that > >have resources files: > >message is: "windres.exe: no resources" > > >I've reinstall Dev-C++ 5.0 beta 5 (4.9.5.0) three or four times and i can=B4t > >compile anythig whit resources, not even the simples examples that com= e with > >it. > > >I am using win98. > > >don=B4t understand anything.. > > I am using Windows 98 also and I see this same error.. > It does not occur on my NT box. > Seems it is realated to Windows 98 > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > 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: Elizabeth B. <sog...@ya...> - 2002-08-30 05:40:23
|
> > Hello, > > I'm working my way through C++ in Action. And I'm stuck with the error > > message: > > > > C:\Projects\Winnie\Class.cpp > > In method `void Win::ClassMaker::SetIcons(int)': > > 23 C:\Projects\Winnie\Class.cpp > > no matching function for call to `StdIcon::Load (void *&, int &)' > > 43 C:\Projects\Winnie\Icon.h > > candidates are: void StdIcon::Load(HINSTANCE__ *, int) > > > > I have gone through the files Icon.h, Icon.cpp and the functions are all > > there. Icon.h has also been included in Class.cpp. What could be wrong. > > For > > the record I have all the project files in one directory. I have linker > > errors when I split them into differnt directories. > > > > I'll appreciate your help please. It may not be a match. Try doing such things as casting your parameters to the ones in StdIcon::Load, e.g.: Load( (HINSTANCE) x, (int) y); // you probably won't need to cast the int I've worked through a number of the examples on Reliable Software's site (<http://www.relisoft.com/win32/>) - that and reinterpret_cast caused me the most difficulties. For reinterpret_cast, I just replaced it with a c-style cast (instead of "reinterpret_cast<int> y" I just did "(int) y").q By the way, how do you like that book? I really enjoy Bartosz' fine win32 examples from the link above, esp.the model-view-controller information. Elizabeth |
From: Abhijit S. <mu...@gm...> - 2002-08-30 04:51:46
|
> Is There ANY Way To Put In Graphics AND/OR Sound In A DOS Application??? > Please, Tell How, In Detail, Cause Im Very New At Programming... > Garrett B. > > Email: Jed...@ms... Try the Allegro library. It does sound, graphics, timing, etc. It's meant mainly for games, but there's nothing stopping you from using it for writing programs. It's also very portable (to Linux, Windows, DOS, Solaris, etc.). ___________________________________________________________ Abhijit Shylanath E-mail: mu...@gm... || ibr...@bi... Web-site: http://mudeth.tripod.com/ |
From: Abhijit S. <mu...@gm...> - 2002-08-30 04:51:20
|
Greets, Napoleon. > Hello, > I'm working my way through C++ in Action. And I'm stuck with the error > message: > > C:\Projects\Winnie\Class.cpp > In method `void Win::ClassMaker::SetIcons(int)': > 23 C:\Projects\Winnie\Class.cpp > no matching function for call to `StdIcon::Load (void *&, int &)' > 43 C:\Projects\Winnie\Icon.h > candidates are: void StdIcon::Load(HINSTANCE__ *, int) > > I have gone through the files Icon.h, Icon.cpp and the functions are all > there. Icon.h has also been included in Class.cpp. What could be wrong. > For > the record I have all the project files in one directory. I have linker > errors when I split them into differnt directories. > > I'll appreciate your help please. > > Napoleon. When you place a file in a different directory, say "icon_class", you have to update the #include directive correspondingly. For example, if it was #include "icon.h" when `icon.h' is in the same directory, then, if you move it to `icon_class', it would become: #include "icon_class/icon.h" This is for the header files. For the CPP files, you have to update the Dev-C++ project itself, so it's better that you decide on the directory structure before-hand and stick to it. Hope this helps. ___________________________________________________________ Abhijit Shylanath E-mail: mu...@gm... || ibr...@bi... Web-site: http://mudeth.tripod.com/ |
From: Zendar <ze...@ne...> - 2002-08-30 04:29:38
|
>FROM: teleline.es >DATE: 08/29/2002 06:03:13 >SUBJECT: [Dev-C++] trouble with windres.exe >Sudently i can use resources file.... >Allway the same answer, with all the programs i have tried to compile that >have resources files: >message is: "windres.exe: no resources" >I've reinstall Dev-C++ 5.0 beta 5 (4.9.5.0) three or four times and i can´t >compile anythig whit resources, not even the simples examples that come with >it. >I am using win98. >don´t understand anything.. I am using Windows 98 also and I see this same error.. It does not occur on my NT box. Seems it is realated to Windows 98 |
From: Garrett B. <Jed...@ms...> - 2002-08-29 23:04:28
|
Is There ANY Way To Put In Graphics AND/OR Sound In A DOS Application??? Please, Tell How, In Detail, Cause Im Very New At Programming... Garrett B. Email: Jed...@ms...Get more from the Web. FREE MSN Explorer down= load : http://explorer.msn.com |
From: <Met...@ao...> - 2002-08-29 16:54:23
|
mu...@gm... wrote : > It's a knowledge-based task rather than an intelligence-based one Yes indeed ! And like I was saying earlier, it's a huge-spare-time-based task ! -- Seb |
From: <Met...@ao...> - 2002-08-29 16:52:44
|
mu...@gm... wrote : > In what you do here, you're overwriting the pointer to the memory allocated, > causing a memory leak. Yes indeed ! In fact, I was thinking of one of my program I am currently developping. It makes intensive use of chained lists like this : typedef struct _coldesc { SQLCHAR ColumnName[255]; SQLSMALLINT NameLength; SQLSMALLINT DataType; SQLUINTEGER ColumnSize; SQLSMALLINT DecimalDigits; SQLSMALLINT Nullable; TCHAR *buffer; SQLLEN IndPtr; struct _coldesc *next; }; _coldesc *thisbinding=NULL; _coldesc *firstbinding=NULL; _coldesc *nextbinding=NULL; firstbinding=(_coldesc*)malloc(sizeof(_coldesc)); thisbinding=firstbinding; **Do calls to SQLDescribeCol here** nextbinding=(_coldesc*)malloc(sizeof(_coldesc)); thisbinding->next=nextbinding; thisbinding=thisbinding->next; Sorry for the misunderstanding ! This small code example shows better what I was trying to tell. -- Seb |
From: Napoleon A. <nah...@so...> - 2002-08-29 16:45:24
|
[windows 2000, DevCpp (mingw)]C++ in Action Windows project after script = 9. -------------------------------------------------------------------- Hello, I'm working my way through C++ in Action. And I'm stuck with the error = message: C:\Projects\Winnie\Class.cpp In method `void Win::ClassMaker::SetIcons(int)': 23 C:\Projects\Winnie\Class.cpp no matching function for call to `StdIcon::Load (void *&, int &)' 43 C:\Projects\Winnie\Icon.h candidates are: void StdIcon::Load(HINSTANCE__ *, int) I have gone through the files Icon.h, Icon.cpp and the functions are all = there. Icon.h has also been included in Class.cpp. What could be wrong. = For the record I have all the project files in one directory. I have = linker errors when I split them into differnt directories. I'll appreciate your help please. Napoleon. |
From: Abhijit S. <mu...@gm...> - 2002-08-29 16:28:50
|
> It's rather hard to find good and free res editor. Maybe it's time to write > one. > I was thinking about creating such tool but I'm not sure I can manage. > Do you think it is too big enterprise? It's a knowledge-based task rather than an intelligence-based one. I was, for long considering writing one (using Allegro), but decided not to. For one, you need to know all the controls, the syntax, their peculiarities, the #defines that go into their STYLE statements and their hair colours. That in itself will be a massive task, even if you have a good reference. It'll take a long time to reach a respectable stage. If you try to hurry things up, you'll end up with a half-baked program, and god knows we have enough of those already. This is probably why you say that it's hard to find a `good and free res editor'. However, if you still decide to write one, please let me know, I'd like to help as much as I can. |
From: Abhijit S. <mu...@gm...> - 2002-08-29 16:28:14
|
> Did you allocated the memory needed by the data element pointed to by the struct pointer ? > > Ie : > > typedef struct _s > { > int x,y; > struct -s *next=NULL; Typo: struct_s *next = NULL, right? > } > > struct_s foo; > struct_s bar; Remember this line... > > If you wish to make the foo.next elemnt to point to bar, you must : > > foo.next=(struct _s*)malloc(sizeof(struct _s)); > foo.next=bar; In what you do here, you're overwriting the pointer to the memory allocated, causing a memory leak. It's like saying: b = 25; a = 35; a = b; That's dangerous and unnecessary, since `bar' is already allocated on the stack on the line marked. So you would just have to say foo.next = &bar; Only if `bar' is a pointer would you do this: struct_s *bar; bar = new struct_s; foo.next = bar; Regarding the original problem, of filling up a pointer to a struct, it would be like this: struct_s *foo = new struct_s; foo->value = 25; This will not cause a crash (provided `new' allocated). Also note that `malloc' is considered dangerous (since it doesn't call the constructor), and only `new' should be used. However, for allocating buffers (of chars, etc.), I find it better to use malloc() and realloc(). One more thing, it's always better to initialize all pointers to NULL, so that any error in your code will result in an immediate crash with a NULL-pointer error, rather than a hidden bug that'll surface on the other side of the program and make debugging a nightmare. |
From: <al...@te...> - 2002-08-29 13:03:01
|
Sudently i can use resources file.... Allway the same answer, with all the programs i have tried to compile tha= t have resources files: message is: "windres.exe: no resources" I've reinstall Dev-C++ 5.0 beta 5 (4.9.5.0) three or four times and i can= =B4t compile anythig whit resources, not even the simples examples that come w= ith it. I am using win98. don=B4t understand anything... |
From: <Met...@ao...> - 2002-08-29 12:34:05
|
No, writing a resource editor is not quite difficult to do You just have to set up some dialog boxes and retrieve some values from them. Not so difficult yes, but a very big project anyway. It needs a lot of spare time to do this. LCC's wedit does the job well, apart from some little bugs... Kind regards -- Seb |
From: <Met...@ao...> - 2002-08-29 12:31:21
|
Explain ? Yes indeed... A pointer points (Yes, this is his job !) to a certain piece of memory. If you don't initialise the part of memory where it points, you might get unpredictable values through the pointer or sometimes memory crashes. When you declare a pointer like : struct _s *next; C++ knows that the next pointer points to a part of memory that contains a "struct _s" type of data. BUT a first, the pointer points to...nothing or random adress ! You first have to allocate some memory (malloc) to receive a struct _s data. Then, acessing to the "next" pointer gives you access to a struct _s for *real* this time. But, if you think you're not a CPP hero, I think you might get some books about it and read it from cover to cover. There are a huge amount of tutorials for newbies almost everywhere on the net. Just check out Google for this. Kind regards -- Seb |
From: Adam M. <ada...@sk...> - 2002-08-29 11:38:15
|
It's rather hard to find good and free res editor. Maybe it's time to write one. I was thinking about creating such tool but I'm not sure I can manage. Do you think it is too big enterprise? Upanie. |
From: <Met...@ao...> - 2002-08-29 10:03:08
|
Did you allocated the memory needed by the data element pointed to by the struct pointer ? Ie : typedef struct _s { int x,y; struct -s *next=NULL; } struct _s foo; struct_s bar; If you wish to make the foo.next elemnt to point to bar, you must : foo.next=(struct _s*)malloc(sizeof(struct _s)); foo.next=bar; Kind regards -- Seb |