dev-cpp-users Mailing List for Dev-C++ (Page 7)
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: William Mc C. <wil...@ms...> - 2011-07-07 00:35:28
|
. http://avignonexpo.fr/GOODS.html?ohyahooID=x2ed0 |
From: Zarko M. <zar...@sb...> - 2011-07-04 06:40:00
|
From: William Mc C. <wil...@ms...> - 2011-07-03 21:00:23
|
.. http://geissmannpapier.ch/gods.html?pluckyid=y0i3 |
From: Daniel A. <dan...@jr...> - 2011-06-28 08:17:32
|
Hello, My PC is: Fujitsu-Siemens: CELSIUS model XEON(TM) CPU: 2.8 GHz + 1 Gbytes RAM XP Professional (2002) Service Pack: #3 I simply program in FORTRAN language with Compaq Visual Fortran Professional Edition 6.6.0 (CVF 6.6) and ... It works beautifully !!! OBJECTIVE: 1. I want to use NAG (current version is flw3219DD) with CVF 6.6 !!! 2. I set in Project Settings - Link - Object/library modules (Alt-F7): kernel32.lib c:/flw3219DD/naglib.lib RESULT: After LINK: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Linking... LINK : warning LNK4098: defaultlib "libc.lib" conflicts with use of other libs; use /NODEFAULTLIB:library NAG_appl_1.exe - 0 error(s), 1 warning(s) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ After RUN, I get: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>> > forrtl: severe <157>: Program Exception - access violation ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ QUESTION: 1. is my NAG (flw3219DD) compatible with CVF 6.6 and XP ??? a. if YES, what then ? b. if NO, what would be the compatible NAG version ? Best regards. Daniel -- Daniel Albrecht (PhD) JRC - IPSC - EAS Unit Phone: +39 0332 789237 |
From: Hafijul I. <haf...@ya...> - 2011-06-21 00:50:01
|
Haf...@ya... |
From: JOSEPH V DO <jos...@be...> - 2011-06-17 17:13:25
|
Hello, Will you please show me how to get assembly code when I compiler a program from Dev C++ IDE. Thanks, Joseph V. Do |
From: Per W. <pw...@ia...> - 2011-06-17 16:31:41
|
It doesn't matter if frequency[] is a global or is stored on the stack. It is initialized by {0}, where the first entry gets the explicit value 0, and the other entries gets a default of 0. So there are no repetition of any {0}. If the code had been (global or stack variable doesn't matter): history[11] = {1} then history[] would have been filled with {1,0,0,0,0,0,0,0,0,0,0}; If there hadn't been any assignment, then it would still have been set to zero if global, but left with unknown contents if it had been on the stack (as it currently is). /pwm On Fri, 17 Jun 2011, sam wrote: > Thank you > > --- On Fri, 6/17/11, Robert Alatalo <ral...@gm...> wrote: > > > From: Robert Alatalo <ral...@gm...> > > Subject: Re: [Dev-C++] Array increment in C > > To: "sam" <as...@ya...> > > Cc: dev...@li... > > Date: Friday, June 17, 2011, 4:26 AM > > Hello, > > > > As you go though the loop the responses [ answer ] > > will vary 1 , 2, > > 6, 4, 8 , etc... > > as it goes though the responses array ( hopefully > > there are then then > > 40 items in the array > > as that is the size of the array. Note the size of > > the frequency > > array is 11, it is just not fully initialized (though it > > should > > default to zeros as it's on the stack, and the {0} may be > > repeated to > > fill all 11 slots. > > > > Since the frequency array has 11 slots, it should start out > > as > > 0,0,0,0,0,etc... > > > > As you go though the loop, you increment each slot that is > > indexed by > > the value of responses [ answer ] , ie.. 1, 2, 6, 4, ... > > as the largest value I see if 10, that should not overflow > > the 0 to 10 > > index of the 11 element array. > > > > At the end you just look though the frequency array, > > skipping the > > first element (index zero). > > > > Hope that helps, > > Robert > > > > On Fri, Jun 17, 2011 at 5:56 AM, sam <as...@ya...> > > wrote: > > > Sorry it has been a while since I program. > > > It is a stupid question. So, please forgive my > > ignorance. Maybe I lose my memory or something!! > > > I have a problem with the below code!!! > > > I canât understand this part:    ++frequency [ > > responses [ answer ] ]; > > > I know this part increment 1 to the value position of > > the result of this one responses [ answer ] > > > For example responses [ answer ]= 1; then > >    ++frequency [1] > > > But how did the result of frequency[ rating ]= > > 2,2,2,2,5,11,5,7,1,3 ????? > > > So can you please explain it to me? > > > > > ////////////////////////////////////////////////////// > > > #include <stdio.h> > > > #define RESPONSE_SIZE 40 > > > #define FREQUENCY_SIZE 11 > > > int main() > > > { > > >   int answer, rating, frequency[ FREQUENCY_SIZE ] = > > { 0 }; > > >   int responses[ RESPONSE_SIZE ] = > > >      { 1, 2, 6, 4, 8, 5, 9, 7, 8, 10, > > >        1, 6, 3, 8, 6, 10, 3, 8, 2, 7, > > >        6, 5, 7, 6, 8, 6, 7, 5, 6, 6, > > >        5, 6, 7, 5, 6, 4, 8, 6, 8, 10 }; > > >   for ( answer = 0; answer <= RESPONSE_SIZE - 1; > > answer++ ) > > >     ++frequency [ responses [ answer ] ]; > > >   printf( "%s%17s\n", "Rating", "Frequency" ); > > >   for ( rating = 1; rating <= FREQUENCY_SIZE - > > 1; rating++ ) > > >      printf( "%6d%17d\n", rating, frequency[ > > rating ] ); > > >   getchar(); > > >   return 0;} > > > ////////////////////// > > > > > > > > ------------------------------------------------------------------------------ > > > EditLive Enterprise is the world's most technically > > advanced content > > > authoring tool. Experience the power of Track Changes, > > Inline Image > > > Editing and ensure content is compliant with > > Accessibility Checking. > > > http://p.sf.net/sfu/ephox-dev2dev > > > _______________________________________________ > > > Dev-cpp-users mailing list > > > Dev...@li... > > > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > > > > > ------------------------------------------------------------------------------ > EditLive Enterprise is the world's most technically advanced content > authoring tool. Experience the power of Track Changes, Inline Image > Editing and ensure content is compliant with Accessibility Checking. > http://p.sf.net/sfu/ephox-dev2dev > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
From: sam <as...@ya...> - 2011-06-17 11:50:07
|
Thank you --- On Fri, 6/17/11, Robert Alatalo <ral...@gm...> wrote: > From: Robert Alatalo <ral...@gm...> > Subject: Re: [Dev-C++] Array increment in C > To: "sam" <as...@ya...> > Cc: dev...@li... > Date: Friday, June 17, 2011, 4:26 AM > Hello, > > As you go though the loop the responses [ answer ] > will vary 1 , 2, > 6, 4, 8 , etc... > as it goes though the responses array ( hopefully > there are then then > 40 items in the array > as that is the size of the array. Note the size of > the frequency > array is 11, it is just not fully initialized (though it > should > default to zeros as it's on the stack, and the {0} may be > repeated to > fill all 11 slots. > > Since the frequency array has 11 slots, it should start out > as > 0,0,0,0,0,etc... > > As you go though the loop, you increment each slot that is > indexed by > the value of responses [ answer ] , ie.. 1, 2, 6, 4, ... > as the largest value I see if 10, that should not overflow > the 0 to 10 > index of the 11 element array. > > At the end you just look though the frequency array, > skipping the > first element (index zero). > > Hope that helps, > Robert > > On Fri, Jun 17, 2011 at 5:56 AM, sam <as...@ya...> > wrote: > > Sorry it has been a while since I program. > > It is a stupid question. So, please forgive my > ignorance. Maybe I lose my memory or something!! > > I have a problem with the below code!!! > > I can’t understand this part: ++frequency [ > responses [ answer ] ]; > > I know this part increment 1 to the value position of > the result of this one responses [ answer ] > > For example responses [ answer ]= 1; then > ++frequency [1] > > But how did the result of frequency[ rating ]= > 2,2,2,2,5,11,5,7,1,3 ????? > > So can you please explain it to me? > > > ////////////////////////////////////////////////////// > > #include <stdio.h> > > #define RESPONSE_SIZE 40 > > #define FREQUENCY_SIZE 11 > > int main() > > { > > int answer, rating, frequency[ FREQUENCY_SIZE ] = > { 0 }; > > int responses[ RESPONSE_SIZE ] = > > { 1, 2, 6, 4, 8, 5, 9, 7, 8, 10, > > 1, 6, 3, 8, 6, 10, 3, 8, 2, 7, > > 6, 5, 7, 6, 8, 6, 7, 5, 6, 6, > > 5, 6, 7, 5, 6, 4, 8, 6, 8, 10 }; > > for ( answer = 0; answer <= RESPONSE_SIZE - 1; > answer++ ) > > ++frequency [ responses [ answer ] ]; > > printf( "%s%17s\n", "Rating", "Frequency" ); > > for ( rating = 1; rating <= FREQUENCY_SIZE - > 1; rating++ ) > > printf( "%6d%17d\n", rating, frequency[ > rating ] ); > > getchar(); > > return 0;} > > ////////////////////// > > > > > ------------------------------------------------------------------------------ > > EditLive Enterprise is the world's most technically > advanced content > > authoring tool. Experience the power of Track Changes, > Inline Image > > Editing and ensure content is compliant with > Accessibility Checking. > > http://p.sf.net/sfu/ephox-dev2dev > > _______________________________________________ > > Dev-cpp-users mailing list > > Dev...@li... > > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > |
From: Robert A. <ral...@gm...> - 2011-06-17 10:26:27
|
Hello, As you go though the loop the responses [ answer ] will vary 1 , 2, 6, 4, 8 , etc... as it goes though the responses array ( hopefully there are then then 40 items in the array as that is the size of the array. Note the size of the frequency array is 11, it is just not fully initialized (though it should default to zeros as it's on the stack, and the {0} may be repeated to fill all 11 slots. Since the frequency array has 11 slots, it should start out as 0,0,0,0,0,etc... As you go though the loop, you increment each slot that is indexed by the value of responses [ answer ] , ie.. 1, 2, 6, 4, ... as the largest value I see if 10, that should not overflow the 0 to 10 index of the 11 element array. At the end you just look though the frequency array, skipping the first element (index zero). Hope that helps, Robert On Fri, Jun 17, 2011 at 5:56 AM, sam <as...@ya...> wrote: > Sorry it has been a while since I program. > It is a stupid question. So, please forgive my ignorance. Maybe I lose my memory or something!! > I have a problem with the below code!!! > I can’t understand this part: ++frequency [ responses [ answer ] ]; > I know this part increment 1 to the value position of the result of this one responses [ answer ] > For example responses [ answer ]= 1; then ++frequency [1] > But how did the result of frequency[ rating ]= 2,2,2,2,5,11,5,7,1,3 ????? > So can you please explain it to me? > ////////////////////////////////////////////////////// > #include <stdio.h> > #define RESPONSE_SIZE 40 > #define FREQUENCY_SIZE 11 > int main() > { > int answer, rating, frequency[ FREQUENCY_SIZE ] = { 0 }; > int responses[ RESPONSE_SIZE ] = > { 1, 2, 6, 4, 8, 5, 9, 7, 8, 10, > 1, 6, 3, 8, 6, 10, 3, 8, 2, 7, > 6, 5, 7, 6, 8, 6, 7, 5, 6, 6, > 5, 6, 7, 5, 6, 4, 8, 6, 8, 10 }; > for ( answer = 0; answer <= RESPONSE_SIZE - 1; answer++ ) > ++frequency [ responses [ answer ] ]; > printf( "%s%17s\n", "Rating", "Frequency" ); > for ( rating = 1; rating <= FREQUENCY_SIZE - 1; rating++ ) > printf( "%6d%17d\n", rating, frequency[ rating ] ); > getchar(); > return 0;} > ////////////////////// > > ------------------------------------------------------------------------------ > EditLive Enterprise is the world's most technically advanced content > authoring tool. Experience the power of Track Changes, Inline Image > Editing and ensure content is compliant with Accessibility Checking. > http://p.sf.net/sfu/ephox-dev2dev > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
From: sam <as...@ya...> - 2011-06-17 09:57:04
|
Sorry it has been a while since I program. It is a stupid question. So, please forgive my ignorance. Maybe I lose my memory or something!! I have a problem with the below code!!! I can’t understand this part: ++frequency [ responses [ answer ] ]; I know this part increment 1 to the value position of the result of this one responses [ answer ] For example responses [ answer ]= 1; then ++frequency [1] But how did the result of frequency[ rating ]= 2,2,2,2,5,11,5,7,1,3 ????? So can you please explain it to me? ////////////////////////////////////////////////////// #include <stdio.h> #define RESPONSE_SIZE 40 #define FREQUENCY_SIZE 11 int main() { int answer, rating, frequency[ FREQUENCY_SIZE ] = { 0 }; int responses[ RESPONSE_SIZE ] = { 1, 2, 6, 4, 8, 5, 9, 7, 8, 10, 1, 6, 3, 8, 6, 10, 3, 8, 2, 7, 6, 5, 7, 6, 8, 6, 7, 5, 6, 6, 5, 6, 7, 5, 6, 4, 8, 6, 8, 10 }; for ( answer = 0; answer <= RESPONSE_SIZE - 1; answer++ ) ++frequency [ responses [ answer ] ]; printf( "%s%17s\n", "Rating", "Frequency" ); for ( rating = 1; rating <= FREQUENCY_SIZE - 1; rating++ ) printf( "%6d%17d\n", rating, frequency[ rating ] ); getchar(); return 0;} ////////////////////// |
From: Grodzki <gr...@ir...> - 2011-06-13 09:48:59
|
----- Original Message ----- From: <dev...@li...> To: <gr...@ir...> Sent: Monday, June 13, 2011 7:10 AM Subject: Welcome to the "Dev-cpp-users" mailing list (Digest mode) > Welcome to the Dev...@li... mailing list! > > To post to this list, send your email to: > > dev...@li... > > General information about the mailing list is at: > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > If you ever want to unsubscribe or change your options (eg, switch to > or from digest mode, change your password, etc.), visit your > subscription page at: > > > https://lists.sourceforge.net/lists/options/dev-cpp-users/grod777%40ireland.com > > > You can also make such adjustments via email by sending a message to: > > Dev...@li... > > with the word `help' in the subject or body (don't include the > quotes), and you will get back a message with instructions. > > You must know your password to change your options (including changing > the password, itself) or to unsubscribe. It is: > > l;GHfM%jk*I&yhj:?<BUYG > > Normally, Mailman will remind you of your lists.sourceforge.net > mailing list passwords once every month, although you can disable this > if you prefer. This reminder will also include instructions on how to > unsubscribe or change your account options. There is also a button on > your options page that will email your current password to you. |
From: William Mc C. <wil...@ms...> - 2011-06-01 09:44:34
|
.. http://bds-server.com/terr.php?ewtopicid=82go |
From: Jordan B. <jor...@me...> - 2011-05-31 21:25:26
|
I am currently creating a simple console application that will connect to remote database. I am using visaul studio 2005 and have created a new win32 console application. I am wanting to know how do I go about conencting to a database within C++ using the available APIs. I know they are a couple and I have googled about three different one from many different sources and am still confused. If someone could show me a related article or internet tutorial on how to do this or a general example of what it should look like with a specfic API I would greatly appreciate it. |
From: William Mc C. <wil...@ms...> - 2011-05-30 22:22:33
|
hello! http://autoschoen.com/gods.html?xshowtopic=fxqjx |
From: William Mc C. <wil...@ms...> - 2011-05-27 12:02:27
|
hello! http://www.serviceitalia.it/terr.php?ohgmailID=28so0 |
From: William Mc C. <wil...@ms...> - 2011-05-26 05:13:28
|
http://www.haberbox.com/terr.php |
From: William Mc C. <wil...@ms...> - 2011-05-22 01:10:08
|
http://www.supersaw.us/ter.html |
From: William Mc C. <wil...@ms...> - 2011-05-20 16:22:23
|
http://tomassaucedo.com.ar/gods.html |
From: William Mc C. <wil...@ms...> - 2011-05-19 13:30:45
|
http://ecodepot.fr/gods.html |
From: William Mc C. <wil...@ms...> - 2011-05-17 15:19:22
|
http://stacon.pl/gods.html |
From: William Mc C. <wil...@ms...> - 2011-05-14 16:15:50
|
http://graficamanchester.com.br/goods.html |
From: Per W. <pw...@ia...> - 2011-05-11 20:49:56
|
What I can recommend here is that you really make yourself comfortable with the debugger of your choice. A couple of things: - Few programs will work on first attempt. Debugging is almost always needed. - With more experience, it will be easier and easier to just read code and see bugs so a very large percentage of bugs can be handled just by looking at symptoms and maybe adding some printouts to find out if the problem happens before or after something else. - In your case, you guess that you have a problem with your heap. It's important to not be too quick deciding what a problem is but always keep an open mind: What different problems may there be that makes a specific source code line or function call to fail. There are very often more than one potential reason, meaning that these alternatives have to be checked one-by-one. So very standard scientific methods to try to prove theories or prove that the theory was wrong. - Something you seem to constantly forget is to explicitly look at corner cases. What happens for the special case when you try to insert the first element in an empty list? What happens when you want to insert a new elemnt before the currently first element? What happens when you want to insert a new element after all other elements? - A very big question here - are you even building your source code with full warnings enabled? The compiler is very good at spotting uninitialized variables, unless the variables are global. Sometimes it takes a bit higher optimization to get the compiler to make more advanced flow-control analysis to figure out unreachable code or variables that can be reached without an initialization. - As already noted by other readers, you have source lines that assign a value to a specific variable and then directly the line after checks what value the variable has. Are you really working methodical and scientific when analyzing your program? Are you taking a break and then revisiting the code and single-stepping the code in your head, trying to see exactly what the different lines does and why you need the lines? A professional software developer normally don't have any web forums available for debugging their code. They may use a web forum or mailing list to try to ask for missing information or known workarounds to problems they have found. But actual debugging can't be offloaded to any web forum since the programs are too large and normally contains proprietary code that can't be posted. This means that a software developer really must spend the required time to try to master the craft of problem solving. Both solving the customers original problem - what program to write to fulfill a requirements specification. But also debugging written code to verify that it does work as expected and does solve the same problem as the requirements specification wanted solved. It really is very well invested time to work on the debugging skills. And what you will find in the end is that being a tiny bit slower when writing the code will save you a lot of time when trying to get the code to work as expected. So first think very carefully at the problem you have. Then decide how to solve it. Then write the code. Then look at the code and think: is this really good code for solving the problem? First them may it be meaningful to start any debugging. It is meaningless to debug code just to later realize that the code solved the wrong problem or is too slow or requires too much memory forcing you to rewrite it. Having to rewrite just means new code to debug. The interesting thing with your posts is that they just always contains a number of code lines and basically "it doesn't work". There is very little information showing exactly what work you have done to try to solve the problem. It should be quite easy to test if a memory allocation fails, or if it is the assign of the receied pointer that fails. There are almost always possible to divide a problem into two smaller problems until the bug is so totally cornered that you can see what is wrong and what needs to be done to fix the problem. Your posts does not show that you do subdivide your problems. When programs gets larger, you really must work that way or you will be unconditionally stuck since the number of potential alternatives will grow as a power function of the code size and only problem subdivision can compensate for the growing complexities. /pwm On Mon, 9 May 2011, Jordan Burnam wrote: > Hey Everyone and good morning, > > I am in the process of creating a to do list console application and > seems I have hit a wall so to speak. Below I have an exert from my > actualy class. I have been trying to get this linked list working and so > far it has failed. I did not know if it was the driver program that was > failing, the class as a whole or this new code. I have excerted this > code into another compiler and have tried to run it by itslef, Upon > running it the console states it has encountered and error and closes. I > have used the debugging mode on my compiler and it fails once it gets to > the first line to create a new varalbe in the heap. I believe this is > becasue all of my dynamic memory on my PC may be full as I get the > "segmentation fault" error. I do not think that all the memory is in use > by the other programs. If anything I should be able to make one Node in > the memory. I just wanted to know before I change computers that it is > in fact the memory being used and not some stupid mistake that I have > made that is causing the problem. Any help would be fantastic! > > > <code> > > > #include <iostream> > #include <cstdlib> > #include <string> > > using namespace std; > > int main() > { > > int numstep; > struct step > { > int stepNum; > string Instruction; > }; > > > struct Node > { > struct step steppy; > Node *ptr_next_node; > }; > Node *Head; > Node *Curr; > Node *Last; > > > > > numstep = 5; > > > for( int i = 1; i <= numstep; i++) > { > (*Head).ptr_next_node = NULL; > if((*Head).ptr_next_node == NULL) > { > > Last = Head; > Curr = Head; > cout << " The " << i << "step, please enter the text for this setp and then press enter: "; > cin >> (*Head).steppy.Instruction; > (*Head).steppy.stepNum = i; > (*Head).ptr_next_node = new Node; > Curr = (*Head).ptr_next_node; > > } > > cout << "The " << i << " step, please enter the text for this step and then press enter: "; > cin >> (*Curr).steppy.Instruction; > (*Curr).steppy.stepNum = i; > (*Curr).ptr_next_node = new Node; > Last = Curr; > Curr = (*Curr).ptr_next_node; > } > > > > > return 0;} > > > </code> |
From: Fernando L. <fer...@gm...> - 2011-05-09 22:17:11
|
Jordan, Head is a pointer, you use it before you assign anything to it, that is probably the cause of the "segmentation fault". It has to be assigned an actual address before you use it. Best regards, Fernando On 9 May 2011 12:44, Jordan Burnam <jor...@me...> wrote: > Hey Everyone and good morning, > > I am in the process of creating a to do list console application and seems > I have hit a wall so to speak. Below I have an exert from my actualy class. > I have been trying to get this linked list working and so far it has failed. > I did not know if it was the driver program that was failing, the class as a > whole or this new code. I have excerted this code into another compiler and > have tried to run it by itslef, Upon running it the console states it has > encountered and error and closes. I have used the debugging mode on my > compiler and it fails once it gets to the first line to create a new varalbe > in the heap. I believe this is becasue all of my dynamic memory on my PC may > be full as I get the "segmentation fault" error. I do not think that all the > memory is in use by the other programs. If anything I should be able to make > one Node in the memory. I just wanted to know before I change computers that > it is in fact the memory being used and not some stupid mistake that I have > made that is causing the problem. Any help would be fantastic! > > > <code> > > > #include <iostream> > #include <cstdlib> > #include <string> > > using namespace std; > > int main() > { > > int numstep; > struct step > { > int stepNum; > string Instruction; > }; > > struct Node > { > struct step steppy; > Node *ptr_next_node; > }; > Node *Head; > Node *Curr; > Node *Last; > > > > > numstep = 5; > > > for( int i = 1; i <= numstep; i++) > { > (*Head).ptr_next_node = NULL; > if((*Head).ptr_next_node == NULL) > { > > Last = Head; > Curr = Head; > cout << " The " << i << "step, please enter the text for this setp and > then press enter: "; > cin >> (*Head).steppy.Instruction; > (*Head).steppy.stepNum = i; > (*Head)ptr_next_node = new Node; > Curr = (*Head).ptr_next_node; > > } > > cout << "The " << i << " step, please enter the text for this step and > then press enter: "; > cin >> (*Curr).steppy.Instruction; > (*Curr).steppy.stepNum = i; > (*Curr).ptr_next_node = new Node; > Last = Curr; > Curr = (*Curr).ptr_next_node; > } > > > > > return 0;} > > </code> > > > ------------------------------------------------------------------------------ > WhatsUp Gold - Download Free Network Management Software > The most intuitive, comprehensive, and cost-effective network > management toolset available today. Delivers lowest initial > acquisition cost and overall TCO of any competing solution. > http://p.sf.net/sfu/whatsupgold-sd > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > |
From: Michal M. <mol...@se...> - 2011-05-09 19:31:04
|
Dne 9.5.2011 17:44, Jordan Burnam napsal(a): > Node *Head; > Node *Curr; > Node *Last; > > > > > numstep = 5; > > > for( int i = 1; i <= numstep; i++) > { > (*Head).ptr_next_node = NULL; Here you are using Head but you haven't allocated it anywhere. There must be Head = new Node; before the for loop. > if((*Head).ptr_next_node == NULL) What is this good for? You just set it to NULL on previous line. > { > > Last = Head; > Curr = Head; > cout << " The " << i << "step, please enter the text for this setp and > then press enter: "; > cin >> (*Head).steppy.Instruction; > (*Head).steppy.stepNum = i; > (*Head)ptr_next_node = new Node; Probably missing . here. Note that (*x).y is the same as x->y in this case. > Curr = (*Head).ptr_next_node; > > } Here you probably intended "else". However it won't work because the if condition will always be true as explained above. > cout << "The " << i << " step, please enter the text for this step and > then press enter: "; > cin >> (*Curr).steppy.Instruction; > (*Curr).steppy.stepNum = i; > (*Curr).ptr_next_node = new Node; > Last = Curr; > Curr = (*Curr).ptr_next_node; =================================== Node *Head; Node *Curr; numstep = 5; Curr = Head = new Node; Head->ptr_next_node = NULL; for( int i = 1; i <= numstep; i++) { cout << " The " << i << "step, please enter the text for this setp and then press enter: "; cin >> Curr->steppy.Instruction; Curr->steppy.stepNum = i; Curr->ptr_next_node = i == numstep ? NULL : new Node; Curr = Curr->ptr_next_node; } Curr = Head; while(Curr) { cout << Curr->steppy.stepNum << " " << Curr->steppy.Instruction << endl; Curr = Curr->ptr_next_node; } |
From: Jordan B. <jor...@me...> - 2011-05-09 15:45:12
|
Hey Everyone and good morning, I am in the process of creating a to do list console application and seems I have hit a wall so to speak. Below I have an exert from my actualy class. I have been trying to get this linked list working and so far it has failed. I did not know if it was the driver program that was failing, the class as a whole or this new code. I have excerted this code into another compiler and have tried to run it by itslef, Upon running it the console states it has encountered and error and closes. I have used the debugging mode on my compiler and it fails once it gets to the first line to create a new varalbe in the heap. I believe this is becasue all of my dynamic memory on my PC may be full as I get the "segmentation fault" error. I do not think that all the memory is in use by the other programs. If anything I should be able to make one Node in the memory. I just wanted to know before I change computers that it is in fact the memory being used and not some stupid mistake that I have made that is causing the problem. Any help would be fantastic! <code> #include <iostream> #include <cstdlib> #include <string> using namespace std; int main() { int numstep; struct step { int stepNum; string Instruction; }; struct Node { struct step steppy; Node *ptr_next_node; }; Node *Head; Node *Curr; Node *Last; numstep = 5; for( int i = 1; i <= numstep; i++) { (*Head).ptr_next_node = NULL; if((*Head).ptr_next_node == NULL) { Last = Head; Curr = Head; cout << " The " << i << "step, please enter the text for this setp and then press enter: "; cin >> (*Head).steppy.Instruction; (*Head).steppy.stepNum = i; (*Head).ptr_next_node = new Node; Curr = (*Head).ptr_next_node; } cout << "The " << i << " step, please enter the text for this step and then press enter: "; cin >> (*Curr).steppy.Instruction; (*Curr).steppy.stepNum = i; (*Curr).ptr_next_node = new Node; Last = Curr; Curr = (*Curr).ptr_next_node; } return 0;} </code> |