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
(13) |
2
(13) |
3
(23) |
4
(57) |
5
(21) |
6
(25) |
7
(11) |
8
(7) |
9
(10) |
10
(13) |
11
(11) |
12
(13) |
13
(8) |
14
(13) |
15
(8) |
16
(1) |
17
(12) |
18
(11) |
19
(22) |
20
(38) |
21
(28) |
22
(16) |
23
(1) |
24
(17) |
25
(13) |
26
(15) |
27
(5) |
28
(5) |
29
(18) |
30
(31) |
31
(36) |
|
|
|
|
|
From: Zodiaq <zo...@ac...> - 2003-03-31 23:41:11
|
Hello Mike and all Dev-C++ users, Tuesday, April 1, 2003, 12:00:05 AM, Mike wrote as follows: MM> Sorry guys, but I don't have time to filter through all the war debate MM> stuff. I wanted to learn about Dev_C++. MM> Until the fighting stops, I have... MM> UNSUBSCRIBED! LOL! why so sudden steps? As some people see this useless stuff about war is just ending (I mean debates here) and I'm glad for that... as for post I read first ~4 of them and when I see new on with one of two subjects I just delete it - you should do the same... these war debates are like pascal vs c++ or linux vs windows - similar in that everyone has his own point of view and (rether) nothing will change it... so I don't worry, why should you (or, as I think, many other people that subscribes this mailing list) ??? Just ignore this spam and go on with work... -- regards, Zodiaq |
From: Mike M. <MM...@ci...> - 2003-03-31 22:00:08
|
Sorry guys, but I don't have time to filter through all the war debate stuff. I wanted to learn about Dev_C++. Until the fighting stops, I have... UNSUBSCRIBED! --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.459 / Virus Database: 258 - Release Date: 2/25/03 |
From: Louis G. <lg...@ya...> - 2003-03-31 19:45:15
|
Come on guys, lets quit this. This is the 16th "Forgive me Again" thread. Take it to another website. There are hundreds of sites out there for this topic. --- Ioannis Vranos <iv...@em...> wrote: > First you create the problems (like Saddam), then you replace them with > others. In the meantime people get killed (I wonder if you would be able > to > cut the guts from another person who fights for his country, with a > knife in > the batttlefield). > > > I think US have got out of control (for accuracy it never had one, US is > a > warzone itself, unbelievable crimes, children eating their parrents > etc). > > > > > Ioannis Vranos > > * Programming pages: http://www.noicys.freeurl.com > * Alternative URL: http://run.to/noicys > > > > > > > -----Original Message----- > From: Santiago Mallea [mailto:sa...@ho...] > Sent: Monday, March 31, 2003 6:51 PM > To: iv...@em...; dev...@li... > Subject: RE: [Dev-C++] Forgive me again! > > > > > > There you go again, trying to change what was said, trying to change > reality. That's your infinite loop. No one said about Americans being > the > master race. All was said is that the US has very good reasons for doing > what is doing, that the brainless "peace" stupidity should stop now. And > the > people understand and get used to the fact that the US will from now on > take > proactive steps (based on facts) to defend iftself, like it or not, as > it > was shown at the UN. > > > God Bless America. > My regards > Santiago > PS: Last time France decided to wait, there was a German flag parade in > Paris... > > > > > > MSN 8 with e-mail virus protection service: 2 months FREE* > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: ValueWeb: > Dedicated Hosting for just $79/mo with 500 GB of bandwidth! > No other company gives more support or power for your dedicated server > http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/ > _______________________________________________ > 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 __________________________________________________ Do you Yahoo!? Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop! http://platinum.yahoo.com |
From: Gabriel L. <gab...@sv...> - 2003-03-31 18:18:00
|
A few days ago I posted a request on howto develop VST plugins in Dev-C++. I have had some answers and discussions and as a result I can now present a first revision of a HowTo On VST Development in Dev-C++ at http://home.tiscali.se/gali/VST/. ys Gabbe of Sweden |
From: Ioannis V. <iv...@em...> - 2003-03-31 18:05:32
|
First you create the problems (like Saddam), then you replace them with others. In the meantime people get killed (I wonder if you would be able = to cut the guts from another person who fights for his country, with a = knife in the batttlefield). I think US have got out of control (for accuracy it never had one, US is = a warzone itself, unbelievable crimes, children eating their parrents = etc). Ioannis Vranos =20 * Programming pages: http://www.noicys.freeurl.com * Alternative URL: http://run.to/noicys -----Original Message----- From: Santiago Mallea [mailto:sa...@ho...]=20 Sent: Monday, March 31, 2003 6:51 PM To: iv...@em...; dev...@li... Subject: RE: [Dev-C++] Forgive me again! There you go again, trying to change what was said, trying to change reality. That's your infinite loop. No one said about Americans being = the master race. All was said is that the US has very good reasons for doing what is doing, that the brainless "peace" stupidity should stop now. And = the people understand and get used to the fact that the US will from now on = take proactive steps (based on facts) to defend iftself, like it or not, as = it was shown at the UN. God Bless America. My regards Santiago PS: Last time France decided to wait, there was a German flag parade in Paris...=20 MSN 8 with e-mail virus protection service: 2 months FREE*=20 |
From: Ioannis V. <iv...@em...> - 2003-03-31 17:58:32
|
> -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of Daniel Glenfield > Sent: Monday, March 31, 2003 4:00 PM > To: dev...@li... > Subject: [Dev-C++] In constructor parameter list x = null > > > Can someone explain this to me? It's in a header file for a class > declaration, for the only constructor of the class. > > CPenWidthsDlg(CWnd* pParent = NULL); > > It's derived from CDialog so I assume that's got something to > do with it. I > am just confused why the parameter is assigned a NULL value. > If I pass in a > pointer will it just get assigned to NULL? then what's the > point? To save me > from having to assign it to NULL in the constructor body or something? If you do not pass any value NULL is passed. In the invocation style: // ... CPenWidthsDlg(); // ... Ioannis Vranos * Programming pages: http://www.noicys.freeurl.com * Alternative URL: http://run.to/noicys |
From: Daniel G. <sp...@ho...> - 2003-03-31 16:29:08
|
ah...yes I see. Thanks very much! >From: Per Westermark <pw...@ia...> >To: Somanathan Kaimal <som...@wi...> >CC: 'Daniel Glenfield' <sp...@ho...>, ><dev...@li...> >Subject: RE: [Dev-C++] In constructor parameter list x = null >Date: Mon, 31 Mar 2003 19:18:25 +0200 (CEST) > >No, not defensive programming. > >It's a default parameter value, if the parameter isn't sent in when >making the call, i.e. a function like > >int sum(int a = 1, b = 2, c = 3) { > return a+b+c; >} > >may be called as: > >printf("%d\n",sum()); // will print 6 (1+2+3) >printf("%d\n",sum(5)); // will print 10 (5+2+3) >printf("%d\n",sum(5,4)); // will print 12 (5+4+3) >printf("%d\n",sum(5,4,7)); // will print 16 (5,4,7) > >Observe, that it's only the rightmost n parameters that may be ignored >when calling a function taking default parameters. The following isn't >allowed: > >int foobar(void *p = NULL, const char *s); > >since there exists a parameter WITHOUT a default value AFTER a parameter >WITH a default parameter. > > /Per W > >On Mon, 31 Mar 2003, Somanathan Kaimal wrote: > > > Hi, > > > > Its assigning a default value NULL to pParent. If you call this proc >with a > > valid pointer it will override this value. This is for error checking > > (Defensive programming). > > > > Somanathan > > > > -----Original Message----- > > From: Daniel Glenfield [mailto:sp...@ho...] > > Sent: Monday, March 31, 2003 6:30 PM > > To: dev...@li... > > Subject: [Dev-C++] In constructor parameter list x = null > > > > Can someone explain this to me? It's in a header file for a class > > declaration, for the only constructor of the class. > > > > CPenWidthsDlg(CWnd* pParent = NULL); > > > > It's derived from CDialog so I assume that's got something to do with >it. I > > am just confused why the parameter is assigned a NULL value. If I pass >in a > > pointer will it just get assigned to NULL? then what's the point? To >save me > > > > from having to assign it to NULL in the constructor body or something? > > > > > > > > > > > > _________________________________________________________________ > > Get Hotmail on your mobile phone > > http://www.msn.co.uk/msnmobile/mobilehotmail > > > > > > > > ------------------------------------------------------- > > This SF.net email is sponsored by: ValueWeb: > > Dedicated Hosting for just $79/mo with 500 GB of bandwidth! > > No other company gives more support or power for your dedicated server > > http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/ > > _______________________________________________ > > 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: ValueWeb: > > Dedicated Hosting for just $79/mo with 500 GB of bandwidth! > > No other company gives more support or power for your dedicated server > > http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/ > > _______________________________________________ > > 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 > > > _________________________________________________________________ It's fast, it's easy and it's free. Get MSN Messenger today! http://www.msn.co.uk/messenger |
From: Per W. <pw...@ia...> - 2003-03-31 16:20:32
|
No, not defensive programming. It's a default parameter value, if the parameter isn't sent in when making the call, i.e. a function like int sum(int a = 1, b = 2, c = 3) { return a+b+c; } may be called as: printf("%d\n",sum()); // will print 6 (1+2+3) printf("%d\n",sum(5)); // will print 10 (5+2+3) printf("%d\n",sum(5,4)); // will print 12 (5+4+3) printf("%d\n",sum(5,4,7)); // will print 16 (5,4,7) Observe, that it's only the rightmost n parameters that may be ignored when calling a function taking default parameters. The following isn't allowed: int foobar(void *p = NULL, const char *s); since there exists a parameter WITHOUT a default value AFTER a parameter WITH a default parameter. /Per W On Mon, 31 Mar 2003, Somanathan Kaimal wrote: > Hi, > > Its assigning a default value NULL to pParent. If you call this proc with a > valid pointer it will override this value. This is for error checking > (Defensive programming). > > Somanathan > > -----Original Message----- > From: Daniel Glenfield [mailto:sp...@ho...] > Sent: Monday, March 31, 2003 6:30 PM > To: dev...@li... > Subject: [Dev-C++] In constructor parameter list x = null > > Can someone explain this to me? It's in a header file for a class > declaration, for the only constructor of the class. > > CPenWidthsDlg(CWnd* pParent = NULL); > > It's derived from CDialog so I assume that's got something to do with it. I > am just confused why the parameter is assigned a NULL value. If I pass in a > pointer will it just get assigned to NULL? then what's the point? To save me > > from having to assign it to NULL in the constructor body or something? > > > > > > _________________________________________________________________ > Get Hotmail on your mobile phone > http://www.msn.co.uk/msnmobile/mobilehotmail > > > > ------------------------------------------------------- > This SF.net email is sponsored by: ValueWeb: > Dedicated Hosting for just $79/mo with 500 GB of bandwidth! > No other company gives more support or power for your dedicated server > http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/ > _______________________________________________ > 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: ValueWeb: > Dedicated Hosting for just $79/mo with 500 GB of bandwidth! > No other company gives more support or power for your dedicated server > http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/ > _______________________________________________ > 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: Santiago M. <sa...@ho...> - 2003-03-31 15:52:05
|
<html><div style='background-color:'><DIV> <P> <HR> </P> <P>There you go again, trying to change what was said, trying to change reality. That's your infinite loop. No one said about Americans being the master race. All was said is that the US has very good reasons for doing what is doing, that the brainless "peace" stupidity should stop now. And the people understand and get used to the fact that the US will from now on take proactive steps (based on facts) to defend iftself, like it or not, as it was shown at the UN.</P> <P>God Bless America.</P> <P>My regards</P> <P>Santiago</P> <P>PS: Last time France decided to wait, there was a German flag parade in Paris... <BR><BR></P></DIV></div><br clear=all><hr>MSN 8 with <a href="http://g.msn.com/8HMEENUS/2740">e-mail virus protection service: </a> 2 months FREE*</html> |
From: Khalid El-K. <kha...@ho...> - 2003-03-31 14:14:37
|
hmm, I believe that every different implementation means new different logic, and a different logic means better/worse performance ... I'll be sending you the final result for comparsion anyway ;) Regards, Khalid Al-Kary > > > > > Hi fellows, > > I'm developing a low-level C-based string manipulation API ... > > in my Implementation of the function "explode" which splits a > > string into > > pieces (with a specified separator) and returns these pieces > > into an array. > > >While you are reinventing the wheel, you can take a look at GLib's >sources at www.gtk.org. More specifically the funciton g_strsplit(): > >http://developer.gnome.org/doc/API/2.0/glib/glib-String-Utility-Functions.ht >ml#g-strsplit > > >Here is the code: > > >Note: "GSList" is a single linked list pointer. > > > > >- 8< - 8< - 8< - 8< - 8< - 8< - 8< - 8< - 8< - 8< - 8< - 8< - 8< > >/** > * g_strsplit: > * @string: a string to split. > * @delimiter: a string which specifies the places at which to split the >string. > * The delimiter is not included in any of the resulting strings, >unless > * @max_tokens is reached. > * @max_tokens: the maximum number of pieces to split @string into. If >this >is > * less than 1, the string is split completely. > * > * Splits a string into a maximum of @max_tokens pieces, using the given > * @delimiter. If @max_tokens is reached, the remainder of @string is >appended > * to the last token. > * > * As a special case, the result of splitting the empty string "" is an >empty > * vector, not a vector containing a single string. The reason for this > * special case is that being able to represent a empty vector is >typically > * more useful than consistent handling of empty elements. If you do need > * to represent empty elements, you'll need to check for the empty string > * before calling g_strsplit(). > * > * Return value: a newly-allocated %NULL-terminated array of strings. Use > * g_strfreev() to free it. > **/ >gchar** >g_strsplit (const gchar *string, > const gchar *delimiter, > gint max_tokens) >{ > GSList *string_list = NULL, *slist; > gchar **str_array, *s; > guint n = 0; > const gchar *remainder; > > g_return_val_if_fail (string != NULL, NULL); > g_return_val_if_fail (delimiter != NULL, NULL); > g_return_val_if_fail (delimiter[0] != '\0', NULL); > > if (max_tokens < 1) > max_tokens = G_MAXINT; > > remainder = string; > s = strstr (remainder, delimiter); > if (s) > { > gsize delimiter_len = strlen (delimiter); > > while (--max_tokens && s) > { > gsize len; > gchar *new_string; > > len = s - remainder; > new_string = g_new (gchar, len + 1); > strncpy (new_string, remainder, len); > new_string[len] = 0; > string_list = g_slist_prepend (string_list, new_string); > n++; > remainder = s + delimiter_len; > s = strstr (remainder, delimiter); > } > } > if (*string) > { > n++; > string_list = g_slist_prepend (string_list, g_strdup (remainder)); > } > > str_array = g_new (gchar*, n + 1); > > str_array[n--] = NULL; > for (slist = string_list; slist; slist = slist->next) > str_array[n--] = slist->data; > > g_slist_free (string_list); > > return str_array; >} > >- 8< - 8< - 8< - 8< - 8< - 8< - 8< - 8< - 8< - 8< > > > > > > > > >Daniel K. O. > > >Only ask questions with yes/no answers if you want "yes" or "no" as the >answer. >http://homepages.tesco.net/~J.deBoynePollard/FGA/questions-with-yes-or-no-an >swers.html > > > > _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus |
From: Khalid El-K. <kha...@ho...> - 2003-03-31 14:10:42
|
More than useful, thank you fellow :-) >Here I send you an example of >a string array resizing on-the-fly as you require... >This possible solution is built with the >"realloc( )" function as you indicated in >your message. > >I hope this example illuminates your way toward >a peaceful programming...Salam alecum!!. >Ricardo. > > >*******************PROGRAM******************* >/* ALLOCATING AND REALLOCATING MEMORY */ >#include <stdio.h> >#include <stdlib.h> > >int main() >{ > char **p; > int N,i; > > printf("Give me the initial array string dimension: "); > scanf("%d", &N); > fflush(stdin); > > /* As you want your initial array dimension is given > by the user and it is allocated in this way */ > > p= (char **)realloc(NULL,N*sizeof(char*)); > for(i=0; i<N ; i++) > { > /*strings of 10 char */ > p[i]= (char*)realloc(NULL,10*sizeof(char)); > printf("dame string %d: ",i); > gets(p[i]); > puts(p[i]); > } > > /* if you need to store still more array strings > you can reuse the reallocate function as follows */ > > printf("Give me the new array string dimension: "); > scanf("%d",&N); > fflush(stdin); > > p= (char **)realloc(p,N*sizeof(char*)); > for(i=i; i<N ; i++) > { > p[i]= (char*)realloc(NULL,10*sizeof(char)); > printf("dame string %d: ",i); > gets(p[i]); > puts(p[i]); > } > > /* Verification of correct string storing */ > printf("\n\n"); > for(i=0; i<N ; i++) puts(p[i]); > > /* At the end it is convenient to free the memory */ > for(i=0; i<N ; i++) free(p[i]); > free(p); > > system("PAUSE"); > return 0; >} > >***************************** > _________________________________________________________________ STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail |
From: Daniel G. <sp...@ho...> - 2003-03-31 13:54:42
|
Cheers _________________________________________________________________ Stay in touch with absent friends - get MSN Messenger http://www.msn.co.uk/messenger |
From: Jorge A. <jab...@ma...> - 2003-03-31 13:33:23
|
---------- Original Message ---------------------------------- From: swagat kumar <sw...@ma...> Reply-To: sw...@ma... Date: Sat, 29 Mar 2003 07:49:50 -0800 (PST) Yes, the generation of random numbers has always been trickery and a challenge to mathematicians. The rand() function of the c++ library generates pseudorandom numbers uniformly distributed. Check http://www2.kenyon.edu/depts/physics/people/sullivan/Research/BrownianMotion/random.html to see a method to obtain numbers responding to a gaussian distribution. I remember the book "numerical recipes" shows an algorithm to generate random numbers. I've got the fortran version of this book, however there is a C++ version I believe (hey, algorithms are beyond a programming language!). >HI ! >friends, >is it possible to generate random number with gaussian distribution ( say, with mean a and variance p).are there any such random function in c++ library. > >thanks > > > >_____________________________________________________________ >Get email for your site ---> http://www.everyone.net > >_____________________________________________________________ >Select your own custom email address for FREE! Get yo...@yo... w/No Ads, 6MB, POP & more! http://www.everyone.net/selectmail?campaign=tag > > >------------------------------------------------------- >This SF.net email is sponsored by: >The Definitive IT and Networking Event. Be There! >NetWorld+Interop Las Vegas 2003 -- Register today! >http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en >_______________________________________________ >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: Somanathan K. <som...@wi...> - 2003-03-31 13:19:52
|
Hi, Its assigning a default value NULL to pParent. If you call this proc with a valid pointer it will override this value. This is for error checking (Defensive programming). Somanathan -----Original Message----- From: Daniel Glenfield [mailto:sp...@ho...] Sent: Monday, March 31, 2003 6:30 PM To: dev...@li... Subject: [Dev-C++] In constructor parameter list x = null Can someone explain this to me? It's in a header file for a class declaration, for the only constructor of the class. CPenWidthsDlg(CWnd* pParent = NULL); It's derived from CDialog so I assume that's got something to do with it. I am just confused why the parameter is assigned a NULL value. If I pass in a pointer will it just get assigned to NULL? then what's the point? To save me from having to assign it to NULL in the constructor body or something? _________________________________________________________________ Get Hotmail on your mobile phone http://www.msn.co.uk/msnmobile/mobilehotmail ------------------------------------------------------- This SF.net email is sponsored by: ValueWeb: Dedicated Hosting for just $79/mo with 500 GB of bandwidth! No other company gives more support or power for your dedicated server http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/ _______________________________________________ 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: Daniel G. <sp...@ho...> - 2003-03-31 13:00:30
|
Can someone explain this to me? It's in a header file for a class declaration, for the only constructor of the class. CPenWidthsDlg(CWnd* pParent = NULL); It's derived from CDialog so I assume that's got something to do with it. I am just confused why the parameter is assigned a NULL value. If I pass in a pointer will it just get assigned to NULL? then what's the point? To save me from having to assign it to NULL in the constructor body or something? _________________________________________________________________ Get Hotmail on your mobile phone http://www.msn.co.uk/msnmobile/mobilehotmail |
From: Ricardo R. <ri...@po...> - 2003-03-31 09:56:01
|
Here I send you an example of a string array resizing on-the-fly as you require... This possible solution is built with the "realloc( )" function as you indicated in your message. I hope this example illuminates your way toward a peaceful programming...Salam alecum!!. Ricardo. *******************PROGRAM******************* /* ALLOCATING AND REALLOCATING MEMORY */ #include <stdio.h> #include <stdlib.h> int main() { char **p; int N,i; printf("Give me the initial array string dimension: "); scanf("%d", &N); fflush(stdin); /* As you want your initial array dimension is given by the user and it is allocated in this way */ p= (char **)realloc(NULL,N*sizeof(char*)); for(i=0; i<N ; i++) { /*strings of 10 char */ p[i]= (char*)realloc(NULL,10*sizeof(char)); printf("dame string %d: ",i); gets(p[i]); puts(p[i]); } /* if you need to store still more array strings you can reuse the reallocate function as follows */ printf("Give me the new array string dimension: "); scanf("%d",&N); fflush(stdin); p= (char **)realloc(p,N*sizeof(char*)); for(i=i; i<N ; i++) { p[i]= (char*)realloc(NULL,10*sizeof(char)); printf("dame string %d: ",i); gets(p[i]); puts(p[i]); } /* Verification of correct string storing */ printf("\n\n"); for(i=0; i<N ; i++) puts(p[i]); /* At the end it is convenient to free the memory */ for(i=0; i<N ; i++) free(p[i]); free(p); system("PAUSE"); return 0; } ***************************** |
From: Defiant H. <he...@er...> - 2003-03-31 08:00:15
|
I learned a lot from this tutorial: http://www.cprogramming.com/tutorial.html > I am new to C++ and I was wondering if anyone could suggest some texts > for programming practice (outside the enormous textbook required for the > class-we joke that it can serve double duty as we can also use it for > weighttraining). Thanks! :o) |
From: Ioannis V. <iv...@em...> - 2003-03-31 07:48:15
|
After concluding who has the most average of Internet access, we can = turn to how many tv channels/population evey country has. Here in my town we = have ~=3D20 that I consider serious and we are about 5 million. People get real! :) Lets stop the discussion whether americans are the master race, they are not. :) Personally if this war keeps going for = more than the next 2 months I foresee them making numoerous movies about how = they won in Iraq war (as they did for Vietnam). But this discussion should not take place... I just posted a message if anyone wants to go to http://www.peacepledge.org/ just to sign for = PEACE. Now this discussion about how americans discovered the fire and made the civilization I do not know how it came up in the list. Let's talk about code. Ioannis Vranos =20 * Programming pages: http://www.noicys.freeurl.com * Alternative URL: http://run.to/noicys -----Original Message----- From: dev...@li... [mailto:dev...@li...] On Behalf Of Bjorn Terelius Sent: Monday, March 31, 2003 10:14 AM To: sa...@ho... Cc: Dev...@li... Subject: Re: [Dev-C++] Forgive me again! Who has the best access depend upon how you count. Statisics can always = be manipulated to show what you want. The following example(follow the link = at: http://www.etcnewmedia.com/review/default.asp?SectionID=3D11 to NUA's = hompage) could show either that the greatest increase was in the US or that the = US had a mere 3% increase. "The US posted the greatest increase in the number of adults online over = the same period with nearly 10 million people over the age of 16 gaining Net access. As a percentage of population, however this number represents a three percent increase for the US, compared to Spain which saw a 22 = percent rise in the percentage of the population online." Personally, I don't think the US has an overwhelming superiority in computer&internet access. We have 4 computers at home (2 of them share a = 2,5 Mbps connection) and that is not uncommon in Sweden. Let's conclude that many developed contries have good access to the internet, and computers = in general. Best regards Bjorn Terelius ps. I'm sorry to violate our agreement to end this discussion. ;-) >From: "Santiago"=20 >To: "Per Westermark"=20 >CC: "Dev-C++ Mailing List"=20 >Subject: Re: [Dev-C++] Forgive me again!=20 >Date: Sun, 30 Mar 2003 19:08:13 -0500=20 >=20 >Firstable, my apologies for the CAPS. I've tried to keep quiet for too = long >now and I just had enough of this anti-American senseless garbage all = over. >It's not only by the means of internet access but thanks for the site.=20 >Indeed, let's review your source of data facts:=20 >Demographics=20 >=20 > a.. According to IDATE, 9.8% of the population worldwide had access to = the >Internet in 2002, up from 7.9% in 2001. IDATE estimates that the figure will=20 >reach 15.8% by 2006. The company also provided Internet penetration = levels=20 >by international regions in 2002: (estimate for 2006 are shown in = brackets) > a.. North America: 66.7% (81.0%)=20 >=20 > b.. Western Europe (including Scandinavia): 37.9% (51.4%)=20 >=20 > c.. Eastern Europe (including Russia): 7.0% (15.4%)=20 >=20 > d.. Asia-Pacific: 6.4% (13.3%)=20 >=20 > e.. Latin America: 5.4% (9.1%)=20 >=20 > f.. Africa/Middle East (including Turkey and South Africa): 1.1% = (3.1%)=20 > (eMarketer Daily - Issue 54, March 2003)=20 >Taken from: = http://www.etcnewmedia.com/review/default.asp?SectionID=3D10=20 >=20 >This is all besides the fact that Americans have been to more foreign=20 >countries and visited their cultures more then any citizen in the = planet.=20 >Besides that (hate it or not) America is the most culturally diverse country=20 >in the world where even foreign American haters living and working here have=20 >the freedom the express their views without legal reprisal. Let me know = if=20 >you need more reasons to believe that Americans are the most informed = (and=20 >nicest) people out there.=20 >I know that what I say may not be in a classic American politically = correct >style. However, while I know hatred my obscure reality, I believe it's = time >for a "reality check."=20 >=20 >My regards Mr. Per=20 >Santiago=20 >=20 >=20 >=20 >=20 >----- Original Message -----=20 >From: "Per Westermark"=20 >To: "Santiago"=20 >Cc: "Khalid El-Kary" ;=20 >=20 >Sent: Sunday, March 30, 2003 8:00 AM=20 >Subject: Re: [Dev-C++] Forgive me again!=20 >=20 >=20 > > No, it is NOT a reality that US has 'the best access to WORLD information'=20 > > if you by that mean internet access, and doesn't count the number of = spy > > satellites for minding other countries bussiness.=20 > >=20 > > = http://eastbay.bizjournals.com/eastbay/stories/2003/02/03/daily25.html=20 > > declares 67% US ADULTS penetration - which of course assumes private = > > surfing on company time. Let's go for total population instead, = since=20 > > obviously growing up without free access to uncoloured information=20 > > is important...=20 > >=20 > > If you check TOTAL population, check link:=20 > > http://www.etcnewmedia.com/review/default.asp?SectionID=3D11=20 > >=20 > > 69.8% Iceland=20 > > 67.8% Sweden=20 > > 63.3% Switzerland=20 > > 62.7% Denmark=20 > > 60.8% Netherlands=20 > > 59.6% Hong Kong=20 > > 59.2% Norway=20 > > 57.6% Austria=20 > > 57.3% USA=20 > > 55.9% Canada=20 > > 55.7% South Korea=20 > >=20 > > First of all, it's considered quite rude to shout - using capital letters=20 > > - in news groups and mails.=20 > >=20 > > Second, to shout without checking facts is even worse.=20 > >=20 > > Might it be that you are not an adult, and hence haven't learned = correct > > social behavour? My previous post did not contain any information=20 > > requiring a shouted answer.=20 > >=20 > > /Per W=20 > >=20 > > On Sat, 29 Mar 2003, Santiago wrote:=20 > >=20 > > > Saddam peaceful??? Ok let's see: 8 years of war with Iran out of=20 >nowhere,=20 > > > then invaded Kwait for no reason. And again you WILL NOT dispute = the=20 >250,000=20 > > > dead people under Saddam regime because you just can't deny that,=20 >neither=20 > > > have an idea on how to explain it or justify it. I'm constantly reading=20 > > > sites around the world; ther can't be no brain washing here in the USA.=20 >The=20 > > > US is one of the only countries in which "internet cafes" can't = work as=20 >a=20 > > > business. And that's because families here have 1, 2,3, more = computers >each,=20 > > > all with internet access. So you could say that Americans have the best=20 > > > access to WORLD information, better than any other country (I know = you >might=20 > > > hate that, it's REALITY). Again, i don't know where you are but if = in=20 >your=20 > > > country 2+2=3D5, then I'll understabd why you say Saddam is = peaceful. It >all=20 > > > comes down to the USA being the best and powerful country in the = world >where=20 > > > lots of things you enjoy were invented, including = computers,computer=20 > > > programming, and C++. So I also understand that it's human nature = to=20 >hate=20 > > > the BEST regardless of the facts. But at the end you and everyone = else >will=20 > > > still want to be like the best.=20 > > > Saddam is evil and must go very soon and any other evil county = MUST=20 >until=20 > > > there's no more crazy fanatic regimes threating this blessed land! = > > >=20 > > >=20 > > >=20 > > >=20 > > >=20 > > > ----- Original Message -----=20 > > > From: "Khalid El-Kary"=20 > > > To:=20 > > > Sent: Saturday, March 29, 2003 6:34 PM=20 > > > Subject: [Dev-C++] Forgive me again!=20 > > >=20 > > >=20 > > > > Hi again fellow,=20 > > > >=20 > > > > >See , I didn't say the main purpose of the US was to rescue = those=20 >poor=20 > > > > >people. However, the result of the US going in, will be peace,=20 >stability,=20 > > > >=20 > > > > so you believe that US isn't there for rescuing people ?=20 > > > > did they tell you that before USA came saddam killed people in groups?=20 >why=20 > > > > do they raise his name and his pictures in TV ? are these poor people=20 > > > > kidding us in war ?=20 > > > > Iraq was peaceful until you came, if it wasn't, people wouldn't = have > > > killed=20 > > > > you fellow, people would have really put flowers for you to get = in,=20 >but=20 > > > this=20 > > > > is not true, Iraqi people, are currently killing US soldiers who = are >your=20 > > > > brothers as i suppose. how can you explain to me that a civilian Iraqi=20 > > > woman=20 > > > > kills three US soldiers ? do you think such a woman, doesn't = love=20 >saddam ?=20 > > > > Iraqi people love saddam, this is not my words, it's words of = people >who=20 > > > > went to Iraq, my maths teacher was there, he told me that Iraqi people=20 > > > love=20 > > > > saddam more than any thing ... so can saddam be killing them in=20 >streets ?=20 > > > >=20 > > > > >and much more lives will be saved than if saddam would stay.=20 > > > > >The main purpose of us going in is our defense. Throughout the=20 >history of=20 > > > > >the US and the world, all countries have REACTED to aggression. = > > > > >Unfortunatelly, September 11th, 2001 changed US and world = history.=20 >The=20 > > > US=20 > > > >=20 > > > > you are poor, really poor, because you don't know the truth = fellow,=20 >didn't=20 > > > > you ask yourself why did the people attack you in 11th September = ?=20 >would=20 > > > > they attack to just die ? are they just "coward mad people" ?=20 > > > > I don't think so, they attacked you because you have a hand in = all=20 >that's=20 > > > > done for palastine, you support Israel, can you hide it ?=20 > > > > I don't say that the attack was justice, but the attack wasn't a = >pointless=20 > > > > act, and you should (instead of pro-acting) stop supporting the injust=20 > > > power=20 > > > > of Israel. oh and even more, USA attacked afhganistan and killed = >innocent=20 > > > > people without bringing a proof that Usama Bin Laden is = responsible=20 >...=20 > > > one=20 > > > > of the things that happened there is, destroying an Afghani = hospital ?=20 >plz=20 > > > > study the truth very well, don't just listen to your TV, it's = edited >to=20 > > > > blind you, use your mind to figure the truth out, our TV may = blind us=20 >too=20 > > > by=20 > > > > the way, but I think deeper.=20 > > > >=20 > > > > >is no longer going to REACT, it from now on will PRO-ACT. And that's=20 > > > >=20 > > > > sacrastic again...and kill innocent people in its PRO-ACT ?=20 > > > >=20 > > > > >something the world is going to have to get used to. Before Sep11th,=20 >I=20 > > > > >wou;d=20 > > > >=20 > > > > So you dismiss justice ? i'm worried that saddam is going to be = an=20 >angel=20 > > > if=20 > > > > compared with you, return to justice plz.=20 > > > >=20 > > > > >have disagree with the war. But as you know after Sep 11th we = were=20 > > > attacked=20 > > > >=20 > > > > Killing children doesn't have special circumstances where it's=20 >allowed,=20 > > > your=20 > > > > hand is soiled in their blood. my hand too, because i didn't = stand to=20 > > > defend=20 > > > > them.=20 > > > >=20 > > > > >with biological and weapons, which CANNOT be contained like=20 >communism. We=20 > > > >=20 > > > > they didn't find these weapons so far, and they weren't found = before >the=20 > > > > war, right ? or you attack for the possibilty even ?=20 > > > >=20 > > > > >HAVE to take action against ANT THREAT before it can even get = here. >So=20 > > > it's=20 > > > > >all about life or dead.=20 > > > >=20 > > > > It's all about innocent blood shed, but our god is fair, and = days will=20 > > > make=20 > > > > everyone responsible for innocent blood pay for it.=20 > > > >=20 > > > > >I hope the US continues to be PROACTIVE in the face of = biological or=20 > > > > >chemical threats and I hope some day the world understands that = >because=20 > > > > >from=20 > > > > >now on there is no turning back.=20 > > > >=20 > > > > you remind me of the matrix movie, no turning back, are they a = herd of=20 > > > > sheeps that you kill them with "no turning back" ? they are = humans we=20 > > > should=20 > > > > think 1000000 times before we kill one of them. return to = justice plz.=20 > > > >=20 > > > > your speech is no longer about justice, it's about = pre-protection of > > > yours,=20 > > > > which means killing innocent children, and you could have = avoided it >if=20 > > > you=20 > > > > didn't become our center of hatred, by what you did along the = years=20 >with=20 > > > our=20 > > > > brothers in palastine, now you are even going further, but = there's a >god=20 > > > > above, who sees you, and hears you.=20 > > > >=20 > > > > I'm really sorry for the mailing list, i promise not to post = about=20 >this=20 > > > > topic again, it's for Dev-C++ isn't it ? :)=20 > > > >=20 > > > > Regards,=20 > > > > Khalid AL-Kary=20 > > > >=20 > > > > = _________________________________________________________________=20 > > > > Protect your PC - get McAfee.com VirusScan Online=20 > > > > http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3D3963=20 > > > >=20 > > > >=20 > > > >=20 > > > > -------------------------------------------------------=20 > > > > This SF.net email is sponsored by:=20 > > > > The Definitive IT and Networking Event. Be There!=20 > > > > NetWorld+Interop Las Vegas 2003 -- Register today!=20 > > > > http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en=20 > > > > _______________________________________________=20 > > > > Dev-cpp-users mailing list=20 > > > > Dev...@li...=20 > > > > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm=20 > > > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users=20 > > > >=20 > > >=20 > > >=20 > > > -------------------------------------------------------=20 > > > This SF.net email is sponsored by:=20 > > > The Definitive IT and Networking Event. Be There!=20 > > > NetWorld+Interop Las Vegas 2003 -- Register today!=20 > > > http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en=20 > > > _______________________________________________=20 > > > Dev-cpp-users mailing list=20 > > > Dev...@li...=20 > > > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm=20 > > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users=20 > > >=20 > >=20 > >=20 >=20 >=20 >-------------------------------------------------------=20 >This SF.net email is sponsored by:=20 >The Definitive IT and Networking Event. Be There!=20 >NetWorld+Interop Las Vegas 2003 -- Register today!=20 >http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en=20 >_______________________________________________=20 >Dev-cpp-users mailing list=20 >Dev...@li...=20 >TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm=20 >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users=20 Add photos to your messages with MSN 8. Get 2 months FREE*. ------------------------------------------------------- This SF.net = email is sponsored by: The Definitive IT and Networking Event. Be There! NetWorld+Interop Las Vegas 2003 -- Register today! http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en _______________________________________________ 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: Daniel G. <sp...@ho...> - 2003-03-31 07:34:50
|
Reid, I'll enjoy looking through this myself, thanks. Daniel >From: "Reid Thompson" <Rei...@at...> >To: "Khalid El-Kary" ><kha...@ho...>,<Dev...@li...> >Subject: RE: [Dev-C++] array of strings -- LINKED LIST EXAMPLE >Date: Sun, 30 Mar 2003 20:26:00 -0500 > >From >Practical C Programming, 3rd Edition >By Steve Oualline >3rd Edition August 1997 >1-56592-306-5, Order Number: 3065 >451 pages, $34.95 US, $51.95 CA, £24.95 UK > >http://www.oreilly.com/catalog/pcp3/ > >http://examples.oreilly.com/pcp3/ > >I have 1st edition, I highly recommend this book. > > >/******************************************************** > * Define, use and print out an ordered linked list * > * * > * Usage: * > * list * > * * > * Note: Demonstration of an ordered linked list * > ********************************************************/ >#include <stdio.h> >#include <stdlib.h> > >/******************************************************** > * Item for our linked list * > ********************************************************/ >struct item { > int value; /* Value of the item */ > struct item *next_ptr; /* Pointer to the next item */ >}; > >/******************************************************** > * enter -- enter a value in the linked list. * > * * > * Parameters * > * first_ptr -- pointer th the head of the list * > * value -- value to add to the list * > * * > * Restrictions: The first entry must be the lowest. * > * The list must have one item already * > ********************************************************/ >void enter(struct item *first_ptr, const int value) >{ > struct item *before_ptr; /* Item before this one */ > struct item *after_ptr; /* Item after this one */ > struct item *new_item_ptr; /* Item to add */ > > /* Create new item to add to the list */ > > before_ptr = first_ptr; /* Start at the beginning */ > after_ptr = before_ptr->next_ptr; > > while (1) { > if (after_ptr == NULL) > break; > > if (after_ptr->value >= value) > break; > > /* Advance the pointers */ > after_ptr = after_ptr->next_ptr; > before_ptr = before_ptr->next_ptr; > } > > new_item_ptr = malloc(sizeof(struct item)); > new_item_ptr->value = value; /* Set value of item */ > > before_ptr->next_ptr = new_item_ptr; > new_item_ptr->next_ptr = after_ptr; >} >/******************************************************** > * print -- print the linked list * > * * > * Parameter * > * first_ptr -- pointer to the first item on the * > * list * > ********************************************************/ >void print(struct item *first_ptr) >{ > struct item *cur_ptr; /* Pointer to the current item */ > > for (cur_ptr = first_ptr; cur_ptr != NULL; cur_ptr = >cur_ptr->next_ptr) > printf("%d ", cur_ptr->value); > printf("\n"); >} > >int main() >{ > /* The linked list */ > struct item *head_ptr = NULL; > > head_ptr = malloc(sizeof(struct item)); > > head_ptr->value = 0; > head_ptr->next_ptr = NULL; > > enter(head_ptr, 5); > enter(head_ptr, 4); > enter(head_ptr, 8); > enter(head_ptr, 9); > enter(head_ptr, 1); > enter(head_ptr, 2); > > print(head_ptr); > return (0); >} > >-- >thanks, >reid > > >-----Original Message----- >From: Khalid El-Kary [mailto:kha...@ho...] >Sent: Sunday, March 30, 2003 7:31 PM >To: Dev...@li... >Subject: RE: [Dev-C++] array of strings > > >where can i find information about a linked lists, i don't know about them >*shy* > >thanx for the suggestion :-) > >Regards, >Khalid AL-Kary > >why not return them to a linked list rather than an array? > > > >-- > >thanks, > >reid > > >_________________________________________________________________ >Add photos to your e-mail with MSN 8. Get 2 months FREE*. >http://join.msn.com/?page=features/featuredemail > > > >------------------------------------------------------- >This SF.net email is sponsored by: >The Definitive IT and Networking Event. Be There! >NetWorld+Interop Las Vegas 2003 -- Register today! >http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en >_______________________________________________ >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: >The Definitive IT and Networking Event. Be There! >NetWorld+Interop Las Vegas 2003 -- Register today! >http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en >_______________________________________________ >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 _________________________________________________________________ Express yourself with cool emoticons http://www.msn.co.uk/messenger |
From: Bjorn T. <bjo...@ho...> - 2003-03-31 07:14:16
|
<html><div style='background-color:'><DIV> <P>Who has the best access depend upon how you count. Statisics can always be manipulated to show what you want. The following example(follow the link at: <A href="http://www.etcnewmedia.com/review/default.asp?SectionID=11">http://www.etcnewmedia.com/review/default.asp?SectionID=11</A> to NUA's hompage) could show either that the greatest increase was in the US or that the US had a mere 3% increase.</P> <P>"The US posted the greatest increase in the number of adults online over the same period with nearly 10 million people over the age of 16 gaining Net access. As a percentage of population, however this number represents a three percent increase for the US, compared to Spain which saw a 22 percent rise in the percentage of the population online."<BR><BR>Personally, I don't think the US has an overwhelming superiority in computer&internet access. We have 4 computers at home (2 of them share a 2,5 Mbps connection) and that is not uncommon in Sweden. Let's conclude that many developed contries have good access to the internet, and computers in general.</P> <P>Best regards</P> <P>Bjorn Terelius</P> <P>ps. I'm sorry to violate our agreement to end this discussion. ;-)</P></DIV> <DIV></DIV> <DIV></DIV>>From: "Santiago" <SA...@HO...> <DIV></DIV>>To: "Per Westermark" <PW...@IA...> <DIV></DIV>>CC: "Dev-C++ Mailing List" <DEV...@LI...> <DIV></DIV>>Subject: Re: [Dev-C++] Forgive me again! <DIV></DIV>>Date: Sun, 30 Mar 2003 19:08:13 -0500 <DIV></DIV>> <DIV></DIV>>Firstable, my apologies for the CAPS. I've tried to keep quiet for too long <DIV></DIV>>now and I just had enough of this anti-American senseless garbage all over. <DIV></DIV>>It's not only by the means of internet access but thanks for the site. <DIV></DIV>>Indeed, let's review your source of data facts: <DIV></DIV>>Demographics <DIV></DIV>> <DIV></DIV>> a.. According to IDATE, 9.8% of the population worldwide had access to the <DIV></DIV>>Internet in 2002, up from 7.9% in 2001. IDATE estimates that the figure will <DIV></DIV>>reach 15.8% by 2006. The company also provided Internet penetration levels <DIV></DIV>>by international regions in 2002: (estimate for 2006 are shown in brackets) <DIV></DIV>> a.. North America: 66.7% (81.0%) <DIV></DIV>> <DIV></DIV>> b.. Western Europe (including Scandinavia): 37.9% (51.4%) <DIV></DIV>> <DIV></DIV>> c.. Eastern Europe (including Russia): 7.0% (15.4%) <DIV></DIV>> <DIV></DIV>> d.. Asia-Pacific: 6.4% (13.3%) <DIV></DIV>> <DIV></DIV>> e.. Latin America: 5.4% (9.1%) <DIV></DIV>> <DIV></DIV>> f.. Africa/Middle East (including Turkey and South Africa): 1.1% (3.1%) <DIV></DIV>> (eMarketer Daily - Issue 54, March 2003) <DIV></DIV>>Taken from: http://www.etcnewmedia.com/review/default.asp?SectionID=10 <DIV></DIV>> <DIV></DIV>>This is all besides the fact that Americans have been to more foreign <DIV></DIV>>countries and visited their cultures more then any citizen in the planet. <DIV></DIV>>Besides that (hate it or not) America is the most culturally diverse country <DIV></DIV>>in the world where even foreign American haters living and working here have <DIV></DIV>>the freedom the express their views without legal reprisal. Let me know if <DIV></DIV>>you need more reasons to believe that Americans are the most informed (and <DIV></DIV>>nicest) people out there. <DIV></DIV>>I know that what I say may not be in a classic American politically correct <DIV></DIV>>style. However, while I know hatred my obscure reality, I believe it's time <DIV></DIV>>for a "reality check." <DIV></DIV>> <DIV></DIV>>My regards Mr. Per <DIV></DIV>>Santiago <DIV></DIV>> <DIV></DIV>> <DIV></DIV>> <DIV></DIV>> <DIV></DIV>>----- Original Message ----- <DIV></DIV>>From: "Per Westermark" <PW...@IA...> <DIV></DIV>>To: "Santiago" <SA...@HO...> <DIV></DIV>>Cc: "Khalid El-Kary" <KHA...@HO...>; <DIV></DIV>><DEV...@LI...> <DIV></DIV>>Sent: Sunday, March 30, 2003 8:00 AM <DIV></DIV>>Subject: Re: [Dev-C++] Forgive me again! <DIV></DIV>> <DIV></DIV>> <DIV></DIV>> > No, it is NOT a reality that US has 'the best access to WORLD information' <DIV></DIV>> > if you by that mean internet access, and doesn't count the number of spy <DIV></DIV>> > satellites for minding other countries bussiness. <DIV></DIV>> > <DIV></DIV>> > http://eastbay.bizjournals.com/eastbay/stories/2003/02/03/daily25.html <DIV></DIV>> > declares 67% US ADULTS penetration - which of course assumes private <DIV></DIV>> > surfing on company time. Let's go for total population instead, since <DIV></DIV>> > obviously growing up without free access to uncoloured information <DIV></DIV>> > is important... <DIV></DIV>> > <DIV></DIV>> > If you check TOTAL population, check link: <DIV></DIV>> > http://www.etcnewmedia.com/review/default.asp?SectionID=11 <DIV></DIV>> > <DIV></DIV>> > 69.8% Iceland <DIV></DIV>> > 67.8% Sweden <DIV></DIV>> > 63.3% Switzerland <DIV></DIV>> > 62.7% Denmark <DIV></DIV>> > 60.8% Netherlands <DIV></DIV>> > 59.6% Hong Kong <DIV></DIV>> > 59.2% Norway <DIV></DIV>> > 57.6% Austria <DIV></DIV>> > 57.3% USA <DIV></DIV>> > 55.9% Canada <DIV></DIV>> > 55.7% South Korea <DIV></DIV>> > <DIV></DIV>> > First of all, it's considered quite rude to shout - using capital letters <DIV></DIV>> > - in news groups and mails. <DIV></DIV>> > <DIV></DIV>> > Second, to shout without checking facts is even worse. <DIV></DIV>> > <DIV></DIV>> > Might it be that you are not an adult, and hence haven't learned correct <DIV></DIV>> > social behavour? My previous post did not contain any information <DIV></DIV>> > requiring a shouted answer. <DIV></DIV>> > <DIV></DIV>> > /Per W <DIV></DIV>> > <DIV></DIV>> > On Sat, 29 Mar 2003, Santiago wrote: <DIV></DIV>> > <DIV></DIV>> > > Saddam peaceful??? Ok let's see: 8 years of war with Iran out of <DIV></DIV>>nowhere, <DIV></DIV>> > > then invaded Kwait for no reason. And again you WILL NOT dispute the <DIV></DIV>>250,000 <DIV></DIV>> > > dead people under Saddam regime because you just can't deny that, <DIV></DIV>>neither <DIV></DIV>> > > have an idea on how to explain it or justify it. I'm constantly reading <DIV></DIV>> > > sites around the world; ther can't be no brain washing here in the USA. <DIV></DIV>>The <DIV></DIV>> > > US is one of the only countries in which "internet cafes" can't work as <DIV></DIV>>a <DIV></DIV>> > > business. And that's because families here have 1, 2,3, more computers <DIV></DIV>>each, <DIV></DIV>> > > all with internet access. So you could say that Americans have the best <DIV></DIV>> > > access to WORLD information, better than any other country (I know you <DIV></DIV>>might <DIV></DIV>> > > hate that, it's REALITY). Again, i don't know where you are but if in <DIV></DIV>>your <DIV></DIV>> > > country 2+2=5, then I'll understabd why you say Saddam is peaceful. It <DIV></DIV>>all <DIV></DIV>> > > comes down to the USA being the best and powerful country in the world <DIV></DIV>>where <DIV></DIV>> > > lots of things you enjoy were invented, including computers,computer <DIV></DIV>> > > programming, and C++. So I also understand that it's human nature to <DIV></DIV>>hate <DIV></DIV>> > > the BEST regardless of the facts. But at the end you and everyone else <DIV></DIV>>will <DIV></DIV>> > > still want to be like the best. <DIV></DIV>> > > Saddam is evil and must go very soon and any other evil county MUST <DIV></DIV>>until <DIV></DIV>> > > there's no more crazy fanatic regimes threating this blessed land! <DIV></DIV>> > > <DIV></DIV>> > > <DIV></DIV>> > > <DIV></DIV>> > > <DIV></DIV>> > > <DIV></DIV>> > > ----- Original Message ----- <DIV></DIV>> > > From: "Khalid El-Kary" <KHA...@HO...> <DIV></DIV>> > > To: <DEV...@LI...> <DIV></DIV>> > > Sent: Saturday, March 29, 2003 6:34 PM <DIV></DIV>> > > Subject: [Dev-C++] Forgive me again! <DIV></DIV>> > > <DIV></DIV>> > > <DIV></DIV>> > > > Hi again fellow, <DIV></DIV>> > > > <DIV></DIV>> > > > >See , I didn't say the main purpose of the US was to rescue those <DIV></DIV>>poor <DIV></DIV>> > > > >people. However, the result of the US going in, will be peace, <DIV></DIV>>stability, <DIV></DIV>> > > > <DIV></DIV>> > > > so you believe that US isn't there for rescuing people ? <DIV></DIV>> > > > did they tell you that before USA came saddam killed people in groups? <DIV></DIV>>why <DIV></DIV>> > > > do they raise his name and his pictures in TV ? are these poor people <DIV></DIV>> > > > kidding us in war ? <DIV></DIV>> > > > Iraq was peaceful until you came, if it wasn't, people wouldn't have <DIV></DIV>> > > killed <DIV></DIV>> > > > you fellow, people would have really put flowers for you to get in, <DIV></DIV>>but <DIV></DIV>> > > this <DIV></DIV>> > > > is not true, Iraqi people, are currently killing US soldiers who are <DIV></DIV>>your <DIV></DIV>> > > > brothers as i suppose. how can you explain to me that a civilian Iraqi <DIV></DIV>> > > woman <DIV></DIV>> > > > kills three US soldiers ? do you think such a woman, doesn't love <DIV></DIV>>saddam ? <DIV></DIV>> > > > Iraqi people love saddam, this is not my words, it's words of people <DIV></DIV>>who <DIV></DIV>> > > > went to Iraq, my maths teacher was there, he told me that Iraqi people <DIV></DIV>> > > love <DIV></DIV>> > > > saddam more than any thing ... so can saddam be killing them in <DIV></DIV>>streets ? <DIV></DIV>> > > > <DIV></DIV>> > > > >and much more lives will be saved than if saddam would stay. <DIV></DIV>> > > > >The main purpose of us going in is our defense. Throughout the <DIV></DIV>>history of <DIV></DIV>> > > > >the US and the world, all countries have REACTED to aggression. <DIV></DIV>> > > > >Unfortunatelly, September 11th, 2001 changed US and world history. <DIV></DIV>>The <DIV></DIV>> > > US <DIV></DIV>> > > > <DIV></DIV>> > > > you are poor, really poor, because you don't know the truth fellow, <DIV></DIV>>didn't <DIV></DIV>> > > > you ask yourself why did the people attack you in 11th September ? <DIV></DIV>>would <DIV></DIV>> > > > they attack to just die ? are they just "coward mad people" ? <DIV></DIV>> > > > I don't think so, they attacked you because you have a hand in all <DIV></DIV>>that's <DIV></DIV>> > > > done for palastine, you support Israel, can you hide it ? <DIV></DIV>> > > > I don't say that the attack was justice, but the attack wasn't a <DIV></DIV>>pointless <DIV></DIV>> > > > act, and you should (instead of pro-acting) stop supporting the injust <DIV></DIV>> > > power <DIV></DIV>> > > > of Israel. oh and even more, USA attacked afhganistan and killed <DIV></DIV>>innocent <DIV></DIV>> > > > people without bringing a proof that Usama Bin Laden is responsible <DIV></DIV>>... <DIV></DIV>> > > one <DIV></DIV>> > > > of the things that happened there is, destroying an Afghani hospital ? <DIV></DIV>>plz <DIV></DIV>> > > > study the truth very well, don't just listen to your TV, it's edited <DIV></DIV>>to <DIV></DIV>> > > > blind you, use your mind to figure the truth out, our TV may blind us <DIV></DIV>>too <DIV></DIV>> > > by <DIV></DIV>> > > > the way, but I think deeper. <DIV></DIV>> > > > <DIV></DIV>> > > > >is no longer going to REACT, it from now on will PRO-ACT. And that's <DIV></DIV>> > > > <DIV></DIV>> > > > sacrastic again...and kill innocent people in its PRO-ACT ? <DIV></DIV>> > > > <DIV></DIV>> > > > >something the world is going to have to get used to. Before Sep11th, <DIV></DIV>>I <DIV></DIV>> > > > >wou;d <DIV></DIV>> > > > <DIV></DIV>> > > > So you dismiss justice ? i'm worried that saddam is going to be an <DIV></DIV>>angel <DIV></DIV>> > > if <DIV></DIV>> > > > compared with you, return to justice plz. <DIV></DIV>> > > > <DIV></DIV>> > > > >have disagree with the war. But as you know after Sep 11th we were <DIV></DIV>> > > attacked <DIV></DIV>> > > > <DIV></DIV>> > > > Killing children doesn't have special circumstances where it's <DIV></DIV>>allowed, <DIV></DIV>> > > your <DIV></DIV>> > > > hand is soiled in their blood. my hand too, because i didn't stand to <DIV></DIV>> > > defend <DIV></DIV>> > > > them. <DIV></DIV>> > > > <DIV></DIV>> > > > >with biological and weapons, which CANNOT be contained like <DIV></DIV>>communism. We <DIV></DIV>> > > > <DIV></DIV>> > > > they didn't find these weapons so far, and they weren't found before <DIV></DIV>>the <DIV></DIV>> > > > war, right ? or you attack for the possibilty even ? <DIV></DIV>> > > > <DIV></DIV>> > > > >HAVE to take action against ANT THREAT before it can even get here. <DIV></DIV>>So <DIV></DIV>> > > it's <DIV></DIV>> > > > >all about life or dead. <DIV></DIV>> > > > <DIV></DIV>> > > > It's all about innocent blood shed, but our god is fair, and days will <DIV></DIV>> > > make <DIV></DIV>> > > > everyone responsible for innocent blood pay for it. <DIV></DIV>> > > > <DIV></DIV>> > > > >I hope the US continues to be PROACTIVE in the face of biological or <DIV></DIV>> > > > >chemical threats and I hope some day the world understands that <DIV></DIV>>because <DIV></DIV>> > > > >from <DIV></DIV>> > > > >now on there is no turning back. <DIV></DIV>> > > > <DIV></DIV>> > > > you remind me of the matrix movie, no turning back, are they a herd of <DIV></DIV>> > > > sheeps that you kill them with "no turning back" ? they are humans we <DIV></DIV>> > > should <DIV></DIV>> > > > think 1000000 times before we kill one of them. return to justice plz. <DIV></DIV>> > > > <DIV></DIV>> > > > your speech is no longer about justice, it's about pre-protection of <DIV></DIV>> > > yours, <DIV></DIV>> > > > which means killing innocent children, and you could have avoided it <DIV></DIV>>if <DIV></DIV>> > > you <DIV></DIV>> > > > didn't become our center of hatred, by what you did along the years <DIV></DIV>>with <DIV></DIV>> > > our <DIV></DIV>> > > > brothers in palastine, now you are even going further, but there's a <DIV></DIV>>god <DIV></DIV>> > > > above, who sees you, and hears you. <DIV></DIV>> > > > <DIV></DIV>> > > > I'm really sorry for the mailing list, i promise not to post about <DIV></DIV>>this <DIV></DIV>> > > > topic again, it's for Dev-C++ isn't it ? :) <DIV></DIV>> > > > <DIV></DIV>> > > > Regards, <DIV></DIV>> > > > Khalid AL-Kary <DIV></DIV>> > > > <DIV></DIV>> > > > _________________________________________________________________ <DIV></DIV>> > > > Protect your PC - get McAfee.com VirusScan Online <DIV></DIV>> > > > http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 <DIV></DIV>> > > > <DIV></DIV>> > > > <DIV></DIV>> > > > <DIV></DIV>> > > > ------------------------------------------------------- <DIV></DIV>> > > > This SF.net email is sponsored by: <DIV></DIV>> > > > The Definitive IT and Networking Event. Be There! <DIV></DIV>> > > > NetWorld+Interop Las Vegas 2003 -- Register today! <DIV></DIV>> > > > http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en <DIV></DIV>> > > > _______________________________________________ <DIV></DIV>> > > > Dev-cpp-users mailing list <DIV></DIV>> > > > Dev...@li... <DIV></DIV>> > > > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm <DIV></DIV>> > > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users <DIV></DIV>> > > > <DIV></DIV>> > > <DIV></DIV>> > > <DIV></DIV>> > > ------------------------------------------------------- <DIV></DIV>> > > This SF.net email is sponsored by: <DIV></DIV>> > > The Definitive IT and Networking Event. Be There! <DIV></DIV>> > > NetWorld+Interop Las Vegas 2003 -- Register today! <DIV></DIV>> > > http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en <DIV></DIV>> > > _______________________________________________ <DIV></DIV>> > > Dev-cpp-users mailing list <DIV></DIV>> > > Dev...@li... <DIV></DIV>> > > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm <DIV></DIV>> > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users <DIV></DIV>> > > <DIV></DIV>> > <DIV></DIV>> > <DIV></DIV>> <DIV></DIV>> <DIV></DIV>>------------------------------------------------------- <DIV></DIV>>This SF.net email is sponsored by: <DIV></DIV>>The Definitive IT and Networking Event. Be There! <DIV></DIV>>NetWorld+Interop Las Vegas 2003 -- Register today! <DIV></DIV>>http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en <DIV></DIV>>_______________________________________________ <DIV></DIV>>Dev-cpp-users mailing list <DIV></DIV>>Dev...@li... <DIV></DIV>>TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm <DIV></DIV>>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users <DIV></DIV></div><br clear=all><hr>Add photos to your messages with <a href="http://g.msn.com/8HMGEN/2749">MSN 8. </a> Get 2 months FREE*.</html> |
From: Ioannis V. <iv...@em...> - 2003-03-31 07:08:10
|
You spoke about practice, so here is a good one (I haven't read it but it comes from a very very great person): http://cm.bell-labs.com/cm/cs/tpop Ioannis Vranos * Programming pages: http://www.noicys.freeurl.com * Alternative URL: http://run.to/noicys -----Original Message----- From: dev...@li... [mailto:dev...@li...] On Behalf Of Sylvia Abbott-Bolduc Sent: Monday, March 31, 2003 8:01 AM To: dev...@li... Subject: [Dev-C++] RE: new thread- tutorial information? Hello; I am new to C++ and I was wondering if anyone could suggest some texts for programming practice (outside the enormous textbook required for the class- we joke that it can serve double duty as we can also use it for weight training). Thanks! :o) S.A.B. |
From: Khalid El-K. <kha...@ho...> - 2003-03-31 05:31:54
|
Hi, i found this tutorial more than useful ;) http://www.cplusplus.com/doc/tutorial/ Khalid >Hello; > > I am new to C++ and I was wondering if anyone could suggest some texts >for >programming practice (outside the enormous textbook required for the class- >we joke that it can serve double duty as we can also use it for weight >training). Thanks! :o) > >S.A.B. _________________________________________________________________ The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail |
From: Sylvia Abbott-B. <sea...@ad...> - 2003-03-31 05:00:54
|
Hello;=0D =0D I am new to C++ and I was wondering if anyone could suggest some texts f= or programming practice (outside the enormous textbook required for the clas= s- we joke that it can serve double duty as we can also use it for weight training). Thanks! :o)=0D =0D S.A.B. |
From: Daniel K. O. <dan...@ya...> - 2003-03-31 03:12:50
|
> Hi fellows, > I'm developing a low-level C-based string manipulation API ... > in my Implementation of the function "explode" which splits a > string into > pieces (with a specified separator) and returns these pieces > into an array. While you are reinventing the wheel, you can take a look at GLib's sources at www.gtk.org. More specifically the funciton g_strsplit(): http://developer.gnome.org/doc/API/2.0/glib/glib-String-Utility-Functions.ht ml#g-strsplit Here is the code: Note: "GSList" is a single linked list pointer. - 8< - 8< - 8< - 8< - 8< - 8< - 8< - 8< - 8< - 8< - 8< - 8< - 8< /** * g_strsplit: * @string: a string to split. * @delimiter: a string which specifies the places at which to split the string. * The delimiter is not included in any of the resulting strings, unless * @max_tokens is reached. * @max_tokens: the maximum number of pieces to split @string into. If this is * less than 1, the string is split completely. * * Splits a string into a maximum of @max_tokens pieces, using the given * @delimiter. If @max_tokens is reached, the remainder of @string is appended * to the last token. * * As a special case, the result of splitting the empty string "" is an empty * vector, not a vector containing a single string. The reason for this * special case is that being able to represent a empty vector is typically * more useful than consistent handling of empty elements. If you do need * to represent empty elements, you'll need to check for the empty string * before calling g_strsplit(). * * Return value: a newly-allocated %NULL-terminated array of strings. Use * g_strfreev() to free it. **/ gchar** g_strsplit (const gchar *string, const gchar *delimiter, gint max_tokens) { GSList *string_list = NULL, *slist; gchar **str_array, *s; guint n = 0; const gchar *remainder; g_return_val_if_fail (string != NULL, NULL); g_return_val_if_fail (delimiter != NULL, NULL); g_return_val_if_fail (delimiter[0] != '\0', NULL); if (max_tokens < 1) max_tokens = G_MAXINT; remainder = string; s = strstr (remainder, delimiter); if (s) { gsize delimiter_len = strlen (delimiter); while (--max_tokens && s) { gsize len; gchar *new_string; len = s - remainder; new_string = g_new (gchar, len + 1); strncpy (new_string, remainder, len); new_string[len] = 0; string_list = g_slist_prepend (string_list, new_string); n++; remainder = s + delimiter_len; s = strstr (remainder, delimiter); } } if (*string) { n++; string_list = g_slist_prepend (string_list, g_strdup (remainder)); } str_array = g_new (gchar*, n + 1); str_array[n--] = NULL; for (slist = string_list; slist; slist = slist->next) str_array[n--] = slist->data; g_slist_free (string_list); return str_array; } - 8< - 8< - 8< - 8< - 8< - 8< - 8< - 8< - 8< - 8< Daniel K. O. Only ask questions with yes/no answers if you want "yes" or "no" as the answer. http://homepages.tesco.net/~J.deBoynePollard/FGA/questions-with-yes-or-no-an swers.html |
From: Louis G. <lg...@ya...> - 2003-03-31 02:04:36
|
Hi Balazs who is a member of this list OROSZI_Balázs <or...@vp...> has great code for what he calls "xlist". He code applies to both sorted and unsorted linked lists --- Reid Thompson <Rei...@at...> wrote: > From > Practical C Programming, 3rd Edition > By Steve Oualline > 3rd Edition August 1997 > 1-56592-306-5, Order Number: 3065 > 451 pages, $34.95 US, $51.95 CA, £24.95 UK > > http://www.oreilly.com/catalog/pcp3/ > > http://examples.oreilly.com/pcp3/ > > I have 1st edition, I highly recommend this book. > > > /******************************************************** > * Define, use and print out an ordered linked list * > * * > * Usage: * > * list * > * * > * Note: Demonstration of an ordered linked list * > ********************************************************/ > #include <stdio.h> > #include <stdlib.h> > > /******************************************************** > * Item for our linked list * > ********************************************************/ > struct item { > int value; /* Value of the item */ > struct item *next_ptr; /* Pointer to the next item */ > }; > > /******************************************************** > * enter -- enter a value in the linked list. * > * * > * Parameters * > * first_ptr -- pointer th the head of the list * > * value -- value to add to the list * > * * > * Restrictions: The first entry must be the lowest. * > * The list must have one item already * > ********************************************************/ > void enter(struct item *first_ptr, const int value) > { > struct item *before_ptr; /* Item before this one */ > struct item *after_ptr; /* Item after this one */ > struct item *new_item_ptr; /* Item to add */ > > /* Create new item to add to the list */ > > before_ptr = first_ptr; /* Start at the beginning */ > after_ptr = before_ptr->next_ptr; > > while (1) { > if (after_ptr == NULL) > break; > > if (after_ptr->value >= value) > break; > > /* Advance the pointers */ > after_ptr = after_ptr->next_ptr; > before_ptr = before_ptr->next_ptr; > } > > new_item_ptr = malloc(sizeof(struct item)); > new_item_ptr->value = value; /* Set value of item */ > > before_ptr->next_ptr = new_item_ptr; > new_item_ptr->next_ptr = after_ptr; > } > /******************************************************** > * print -- print the linked list * > * * > * Parameter * > * first_ptr -- pointer to the first item on the * > * list * > ********************************************************/ > void print(struct item *first_ptr) > { > struct item *cur_ptr; /* Pointer to the current item */ > > for (cur_ptr = first_ptr; cur_ptr != NULL; cur_ptr = > cur_ptr->next_ptr) > printf("%d ", cur_ptr->value); > printf("\n"); > } > > int main() > { > /* The linked list */ > struct item *head_ptr = NULL; > > head_ptr = malloc(sizeof(struct item)); > > head_ptr->value = 0; > head_ptr->next_ptr = NULL; > > enter(head_ptr, 5); > enter(head_ptr, 4); > enter(head_ptr, 8); > enter(head_ptr, 9); > enter(head_ptr, 1); > enter(head_ptr, 2); > > print(head_ptr); > return (0); > } > > -- > thanks, > reid > > > -----Original Message----- > From: Khalid El-Kary [mailto:kha...@ho...] > Sent: Sunday, March 30, 2003 7:31 PM > To: Dev...@li... > Subject: RE: [Dev-C++] array of strings > > > where can i find information about a linked lists, i don't know about > them > *shy* > > thanx for the suggestion :-) > > Regards, > Khalid AL-Kary > >why not return them to a linked list rather than an array? > > > >-- > >thanks, > >reid > > > _________________________________________________________________ > Add photos to your e-mail with MSN 8. Get 2 months FREE*. > http://join.msn.com/?page=features/featuredemail > > > > ------------------------------------------------------- > This SF.net email is sponsored by: > The Definitive IT and Networking Event. Be There! > NetWorld+Interop Las Vegas 2003 -- Register today! > http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en > _______________________________________________ > 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: > The Definitive IT and Networking Event. Be There! > NetWorld+Interop Las Vegas 2003 -- Register today! > http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en > _______________________________________________ > 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 __________________________________________________ Do you Yahoo!? Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop! http://platinum.yahoo.com |