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
(1) |
2
|
|
3
(1) |
4
(6) |
5
(6) |
6
|
7
(9) |
8
(5) |
9
(2) |
|
10
|
11
(3) |
12
(8) |
13
(20) |
14
(4) |
15
(8) |
16
(7) |
|
17
(7) |
18
|
19
|
20
(3) |
21
(14) |
22
(2) |
23
(5) |
|
24
(2) |
25
(11) |
26
(14) |
27
(3) |
28
(1) |
29
(1) |
30
(4) |
|
From: Noorez K. <dar...@ho...> - 2005-04-30 22:16:11
|
trying to make something to calculate PI to a large place value. The compile
error is on the marked line
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
const double numerator = 4;
unsigned double PI = 4; // short, signed or unsigned invalid for `PI'
bool add = false;
for(double i = 3; i < 999999999; i+=2)
{
if( add )
{
PI += numerator/i;
add = false;
}
else
{
PI -= numerator/i;
add = true;
}
}
cout << PI << endl << endl;
system("pause");
}
_________________________________________________________________
Don't just Search. Find! http://search.sympatico.msn.ca/default.aspx The new
MSN Search! Check it out!
|
|
From: Per W. <pw...@ia...> - 2005-04-30 20:06:27
|
For the second alternative, it is possible to do (C code): array[1] = malloc(strlen(sentence)+1); if (array[1] != NULL) strcpy(array[1],sentence); or array[1] = "sentence"; note that no allocation is needed to just assign a pointer. However, the above two alternatives may not be combined into: array[1] = malloc(strlen(sentence)+1); array[1] = "sentence"; since the second assign will loose the reference to the memory previously allocated. /Per W On Sat, 30 Apr 2005, David McKen wrote: > Yes there are a couple ways to do this. > > string array[5]; > char * array[5]; > char array[5] [MAX_STRING_LEN]; > > in the first and last method you can just go ahead and use the space > without a need to allocate any memory. The third way is actually quite > wasteful unless you know exactly how long the strings are. For the > second you will have to do something like: > > array[1] = new char[length of sentence + 1]; > array[1] = "sentence"; > > //Once you are done with the sentence > delete [] array[1]; > > That leaves the first method which requires that you be using C++ and > not C, the latter 2 methods work in C as well. > > Hope this helps > David McKen > > Alexsandro Meireles wrote: > > > Hi, dev-c++ users! > > > > Do you know if it is possible to put sentences in an array in the > > following way? > > > > array[0] = "sentence 1"; > > array[1] = "sentence 2" > > and so on... > > > > Any suggestion for this matter, i.e., to put sentences in a array? > > > > Tks in advance!!! > > -- > > Alexsandro Meireles |
|
From: David M. <dml...@co...> - 2005-04-30 17:32:36
|
Yes there are a couple ways to do this. string array[5]; char * array[5]; char array[5] [MAX_STRING_LEN]; in the first and last method you can just go ahead and use the space without a need to allocate any memory. The third way is actually quite wasteful unless you know exactly how long the strings are. For the second you will have to do something like: array[1] = new char[length of sentence + 1]; array[1] = "sentence"; //Once you are done with the sentence delete [] array[1]; That leaves the first method which requires that you be using C++ and not C, the latter 2 methods work in C as well. Hope this helps David McKen Alexsandro Meireles wrote: > Hi, dev-c++ users! > > Do you know if it is possible to put sentences in an array in the > following way? > > array[0] = "sentence 1"; > array[1] = "sentence 2" > and so on... > > Any suggestion for this matter, i.e., to put sentences in a array? > > Tks in advance!!! > -- > Alexsandro Meireles |
|
From: Jarren L. <vb...@gm...> - 2005-04-30 04:09:43
|
You mean like thw same commands used in the DOS shell? I usually just use t=
his:
system("The command[ex.:CLS, PAUSE, etc...]");
that'll work in console programs
On 4/29/05, dev...@li...
<dev...@li...> wrote:
> Send Dev-cpp-users mailing list submissions to
> dev...@li...
>=20
> To subscribe or unsubscribe via the World Wide Web, visit
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
> or, via email, send a message with subject or body 'help' to
> dev...@li...
>=20
> You can reach the person managing the list at
> dev...@li...
>=20
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Dev-cpp-users digest..."
>=20
> Today's Topics:
>=20
> 1. SHFILEOPSTRUCT - WIN32 API (Guillermo Gutierrez)
>=20
> --__--__--
>=20
> Message: 1
> Date: Fri, 29 Apr 2005 04:53:23 -0700
> From: "Guillermo Gutierrez" <ggu...@ma...>
> To: <dev...@li...>
> Subject: [Dev-C++] SHFILEOPSTRUCT - WIN32 API
>=20
> This is a multi-part message in MIME format.
>=20
> ------_=3D_NextPart_001_01C54CB2.0BF08769
> Content-Type: text/plain;
> charset=3D"iso-8859-1"
> Content-Transfer-Encoding: quoted-printable
>=20
> Has anyone ever used the Shell object struct SHFILEOPSTRUCT for any =3D
> shell operations (copy, delete, move) for files in windows?
> I am having trouble getting it to work with copying multiple files that =
=3D
> are named individually instead of just using a wild card (*.*) to select =
=3D
> all files.
>=20
> I would really appreciate any help and suggestions incase anyone has =3D
> done something similar through another method?
>=20
> Guillermo Gutierrez
> Market Scan Information Systems
> Software Q.A. Supervisor
> (818) 575-2000 x2427
> ggu...@ma...
>=20
> ------_=3D_NextPart_001_01C54CB2.0BF08769
> Content-Type: text/html;
> charset=3D"iso-8859-1"
> Content-Transfer-Encoding: quoted-printable
>=20
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
> <HTML>
> <HEAD>
> <META HTTP-EQUIV=3D3D"Content-Type" CONTENT=3D3D"text/html; =3D
> charset=3D3Diso-8859-1">
> <META NAME=3D3D"Generator" CONTENT=3D3D"MS Exchange Server version =3D
> 6.5.7226.0">
> <TITLE>SHFILEOPSTRUCT - WIN32 API</TITLE>
> </HEAD>
> <BODY>
> <!-- Converted from text/rtf format -->
>=20
> <P><I><FONT COLOR=3D3D"#000000" FACE=3D3D"Comic Sans MS">Has anyone ever =
=3D
> used the Shell object struct SHFILEOPSTRUCT for any shell operations =3D
> (copy, delete, move) for files in windows?</FONT></I></P>
>=20
> <P><I><FONT COLOR=3D3D"#000000" FACE=3D3D"Comic Sans MS">I am having trou=
ble =3D
> getting it to work with copying multiple files that are named =3D
> individually instead of just using a wild card (*.*) to select all =3D
> files.</FONT></I></P>
>=20
> <P><I><FONT COLOR=3D3D"#000000" FACE=3D3D"Comic Sans MS">I would really =
=3D
> appreciate any help and suggestions incase anyone has done something =3D
> similar through another method?</FONT></I>
> </P>
>=20
> <P><I><U><B><FONT COLOR=3D3D"#000080" SIZE=3D3D4 FACE=3D3D"Monotype =3D
> Corsiva">Guillermo Gutierrez</FONT></B></U></I>
>=20
> <BR><I><B><FONT COLOR=3D3D"#000080" SIZE=3D3D4 FACE=3D3D"Monotype =3D
> Corsiva">Market Scan Information Systems</FONT></B></I>
>=20
> <BR><I><B><FONT COLOR=3D3D"#000080" SIZE=3D3D4 FACE=3D3D"Monotype =3D
> Corsiva">Software Q.A. Supervisor</FONT></B></I>
>=20
> <BR><I><B><FONT COLOR=3D3D"#000000" SIZE=3D3D4 FACE=3D3D"Monotype =3D
> Corsiva">(818) 575-2000 x2427</FONT></B></I>
>=20
> <BR><B><U><FONT COLOR=3D3D"#0000FF" =3D
> FACE=3D3D"Arial">ggu...@ma...</FONT></U><I></I><I></I></B>
> </P>
>=20
> </BODY>
> </HTML>
> ------_=3D_NextPart_001_01C54CB2.0BF08769--
>=20
> --__--__--
>=20
> _______________________________________________
> 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
>=20
> End of Dev-cpp-users Digest
>
|
|
From: Guillermo G. <ggu...@ma...> - 2005-04-29 11:57:22
|
Has anyone ever used the Shell object struct SHFILEOPSTRUCT for any = shell operations (copy, delete, move) for files in windows? I am having trouble getting it to work with copying multiple files that = are named individually instead of just using a wild card (*.*) to select = all files. I would really appreciate any help and suggestions incase anyone has = done something similar through another method? Guillermo Gutierrez Market Scan Information Systems Software Q.A. Supervisor (818) 575-2000 x2427 ggu...@ma... |
|
From: Alfred P. R. <al...@ya...> - 2005-04-28 00:18:33
|
Hi Theo, From my subscription e-mail response: 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/theopiedade%40hotmail.com (modified to fit your e-mail address hopefully!) Theo Piedade <the...@ho...> wrote: I don't know how I can UNSUBSCRIBE from this list or change the e-mail of reception ? Please anybody help-me how I can unsubscribe ? Theo Piedade "Louco por naturezA, elouQuecendo nA Engenharia" >From: "Martin Roberts" >To: >Subject: [Dev-C++] RE: Dev-cpp-users digest, Vol 1 #2403 - 2 msgs >Date: Tue, 26 Apr 2005 13:37:47 +0200 > >Hi all I'm pretty new in c++ programming. I am finding it very hard to >find >Tutorials on c++ Win32 API. Please HELP its very frustrating... > > >------------------------------------------------------- >SF email is sponsored by - The IT Product Guide >Read honest & candid reviews on hundreds of IT Products from real users. >Discover which products truly live up to the hype. Start reading now. >http://ads.osdn.com/?ad_ide95&alloc_id396&op=click >_______________________________________________ >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 ------------------------------------------------------- SF.Net email is sponsored by: Tell us your software development plans! Take this survey and enter to win a one-year sub to SourceForge.net Plus IDC's 2005 look-ahead and a copy of this survey Click here to start! http://www.idcswdc.com/cgi-bin/survey?id=105hix _______________________________________________ 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 Alfred P. Reaud |
|
From: Theo P. <the...@ho...> - 2005-04-27 23:48:45
|
I don't know how I can UNSUBSCRIBE from this list or change the e-mail of reception ? Please anybody help-me how I can unsubscribe ? Theo Piedade "Louco por naturezA, elouQuecendo nA Engenharia" >From: "Martin Roberts" <Ma...@cr...> >To: <dev...@li...> >Subject: [Dev-C++] RE: Dev-cpp-users digest, Vol 1 #2403 - 2 msgs >Date: Tue, 26 Apr 2005 13:37:47 +0200 > >Hi all I'm pretty new in c++ programming. I am finding it very hard to >find >Tutorials on c++ Win32 API. Please HELP its very frustrating... > > >------------------------------------------------------- >SF email is sponsored by - The IT Product Guide >Read honest & candid reviews on hundreds of IT Products from real users. >Discover which products truly live up to the hype. Start reading now. >http://ads.osdn.com/?ad_ide95&alloc_id396&op=click >_______________________________________________ >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: <Mat...@Ve...> - 2005-04-27 16:59:04
|
Alright, what you need here is called the C++ vector class, which is an
endless array that reallocates itself when it runs out of space.
It's in the <vector> header.
Then you can go:
vector<string> v; v.reserve(numSentences); v.push_back(sentence);
It automatically sets its length. So v.length() can be used as a limit in
loops.
And it supports []. So you can for-loop through the contents.
-----Original Message-----
From: dev...@li...
[mailto:dev...@li...]On Behalf Of Alexsandro
Meireles
Sent: Tuesday, April 26, 2005 8:33 PM
To: Dev C++
Subject: [Dev-C++] Dynamic Storage or Sentences
Hi, all!
I am trying to develop a program to store sentences in an array as you can
see below. I am following the steps: 1) Ask the user the number of
sentences; 2) Given the number of sentences, ask the user to enter Sentence
1 to Sentence n.
As can be seen in my code, if the user enter 10. I will get a char
array[10]. I was trying to store the sentences like: array[0] = "sentence
1"... array[n] ="sentence n", but that was stupid. Because I was trying to
put a sentence in the place of a character.
If I use a pointer to the array maybe I can solve this, but how can a put a
pointer for each sentence generically for afterwards reach them????? With 10
sentences I will need 10 pointers for 10 arrays!!!!
Any suggestions!
Best,
Alex.
PS: You can perfectly compile the source but it is not working properly of
course.
/* Storing sentences dynamically in a array. */
#include <stdio.h>
int numberOfSentences (void);
int max, count;
main()
{
int max = numberOfSentences(); //GAMBIARRA TO PUT MAX INTO THE ARRAY
char *array[max];
printf("The number of sentences is %d.\n", max);
/*Getting sentences from the keyboard*/
for (count = 0; count < max; count++) //Pay attention if the user
doesn't enter the number >ERROR
{
printf("Enter sentence # %d: ", count+1);
array[count] = gets(*array); //This line is working BIZARRE
/*Print the sentences on screen*/
printf("Sentence %d is %s\n", count+1, array[count]);
system("pause"); //ONLY ACCEPTS A SENTENCE WITH AT MOST 10
CHARACTERS. OTHERWISE IT CLOSES.
}
system("pause");
system("pause");
return 0;
}
/* Input number of sentences */
int numberOfSentences (void)
{
printf("Enter the number of sentences: ");
scanf("%d", &max);
//printf("max = %d.", max);
printf("\n");
return max;
}
--
Alexsandro Meireles
___________________________________________________________________
The information contained in this message and any attachment may be
proprietary, confidential, and privileged or subject to the work
product doctrine and thus protected from disclosure. If the reader
of this message is not the intended recipient, or an employee or
agent responsible for delivering this message to the intended
recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited.
If you have received this communication in error, please notify me
immediately by replying to this message and deleting it and all
copies and backups thereof. Thank you.
|
|
From: Alexsandro M. <mei...@gm...> - 2005-04-27 03:33:13
|
Hi, all!
I am trying to develop a program to store sentences in an array as you can=
=20
see below. I am following the steps: 1) Ask the user the number of=20
sentences; 2) Given the number of sentences, ask the user to enter Sentence=
=20
1 to Sentence n.
As can be seen in my code, if the user enter 10. I will get a char=20
array[10]. I was trying to store the sentences like: array[0] =3D "sentence=
=20
1"... array[n] =3D"sentence n", but that was stupid. Because I was trying t=
o=20
put a sentence in the place of a character.
If I use a pointer to the array maybe I can solve this, but how can a put =
a=20
pointer for each sentence generically for afterwards reach them????? With 1=
0=20
sentences I will need 10 pointers for 10 arrays!!!!
Any suggestions!
Best,
Alex.
PS: You can perfectly compile the source but it is not working properly of=
=20
course.
=20
/* Storing sentences dynamically in a array. */
#include <stdio.h>
int numberOfSentences (void);
int max, count;
main()
{
int max =3D numberOfSentences(); //GAMBIARRA TO PUT MAX INTO THE ARRAY
char *array[max];
printf("The number of sentences is %d.\n", max);
/*Getting sentences from the keyboard*/
for (count =3D 0; count < max; count++) //Pay attention if the user doesn't=
=20
enter the number >ERROR
{
printf("Enter sentence # %d: ", count+1);
array[count] =3D gets(*array); //This line is working BIZARRE
/*Print the sentences on screen*/
printf("Sentence %d is %s\n", count+1, array[count]);
system("pause"); //ONLY ACCEPTS A SENTENCE WITH AT MOST 10 CHARACTERS.=20
OTHERWISE IT CLOSES.
}
system("pause");
system("pause");
return 0;
}
/* Input number of sentences */
int numberOfSentences (void)
{
printf("Enter the number of sentences: ");
scanf("%d", &max);
//printf("max =3D %d.", max);
printf("\n");
return max;
}
--=20
Alexsandro Meireles
|
|
From: Kercso J. <joz...@fr...> - 2005-04-26 16:35:56
|
Hi everybody! I'm a completely new user of this great editor, and I would have a several question: - how can I force the Class-Browser pane to refresh itslef? - I have a Class Foo which is declared in foo.h and implemented in foo.cxx If I add both to the project, the "Swap header/source" command works, but in the Class-Browser I see that the association between method declaration and its implementation is not done, so I have a class Foo with several methods (taken from the header) and a several global "Class Foo methods" (taken from the source). I think that each method should be seen only once in the Class-Browser and the user can use the "Go to the declaration" / "Go to the implementation" command to select the header or the source. - If my class Foo is declared in foo_h.h and implemented in foo.cxx, then even the "Swap header/source" command doesn't work. I think that in both last cases the problem is, that the association header-source is calculated from the filenames. It should be calculated using the contents of the files. Regards, Joco |
|
From: Per W. <pw...@ia...> - 2005-04-26 16:35:03
|
When talking about performance, it isn't the quality of the C++ compiler
that is affecting the runtime. It's the algorithmic differences that
matter - number of memory allocations, or the number of string copies.
A number of memory allocations needed when using std::string can be
avoided when using char[] constructs - a lot of strings do have a known
maximum length.
On the other hand, std::string can perform assigns from other std::string
objects without allocating/copying any data, since multiple std::string
objects can share a common string buffer.
/Per W
On Tue, 26 Apr 2005 Mat...@Ve... wrote:
> Yes, it works, but char* is not a very good thing to use any more. It
> creates arbitrary limits on lengths that lead to bugs and security problems.
> On top of this, you get a minimal performance increase because C++ compilers
> and compiler optimization are a great deal better than they used to be not
> long ago.
>
> The whole point of C++ is avoiding these issues with generic programming and
> classes. Best of all the performance hit is minimal. If you look at
> basically every other language in use today besides C, strings are handled
> automatically.
>
> GAWK, perl, C++, etc. all do it using string types.
>
> Sometimes it's not good enough for it just to work. There are other factors
> to consider.
>
> -----Original Message-----
> From: dev...@li...
> [mailto:dev...@li...]On Behalf Of Verne H.
> Bohlender
> Sent: Saturday, February 26, 2005 8:42 AM
> To: Dev C++; Rafael Charnovscki
> Subject: Re: [Dev-C++] Sentences in a array
>
>
> The program works fine once you use what comes with Dev C++ and not
> substitued the headings. I just clipped the code and used the console
> settings and it worked perfectly. Now I'm not sure what he wants it to do
> but it gave me no problems at all.
> Verne the real amateur at C++
>
> > > Alexsandro Meireles wrote:
> >> array[0] = "sentence 1";
> >> array[1] = "sentence 2"
> >> and so on...
> >
> > There are some ways I can remember.
> > The point is defining your array as
> > an array to char pointers.
> >
> > //initializing an array of strings
> > char* sentences[2]={"sentence 1", "sentence 2"};
> >
> > //assigning strings to the array
> > char* sentences[2];
> > sentences[0]="another sentence 1";
> > sentences[1]="another sentence 2";
> >
> > /* allocating memory dinamically and copying
> > the string */
> > strings[0]=(char *)malloc(sentenceLength + 1);
> > strcpy(strings[0],"sentence 1 again");
> >
> > It could be also an bidimensional array of char, but
> > I'd rather use pointers:
> > char sentences[20][101]; //20 sentences with a limit of 100 characters
> >
> > Maybe other developers have more suggestions.
> > I sent a program (attached) just as an example.
> >
> > Hope it helps,
> > Rafael
> >
>
>
> ----------------------------------------------------------------------------
> ----
>
>
> > #include <stdlib.h>
> > #include <string.h>
> >
> > int main (){
> > //initializing an array of strings
> > char* sentences[2]={"sentence 1", "sentence 2"};
> > char* strings[2];
> > int sentenceLength; //(number of characters of your sentence)
> > int i;
> > for (i=0;i<2;i++)
> > printf("%s\n", sentences[i]);
> > system("PAUSE");
> > sentences[0]="another sentence 1";
> > sentences[1]="another sentence 2";
> > for (i=0;i<2;i++)
> > printf("%s\n", sentences[i]);
> > system("PAUSE");
> > sentenceLength = 30; //just an example
> > strings[0]=(char *)malloc(sentenceLength + 1);
> > strcpy(strings[0],"sentence 1 again");
> > sentenceLength = 60; //just an example
> > strings[1]=(char *)malloc(sentenceLength + 1);
> > strcpy(strings[1],"sentence 2 again");
> > for (i=0;i<2;i++)
> > printf("%s\n", strings[i]);
> > system("PAUSE");
> > return 0;
> > }
> >
> >
> >
>
>
> ----------------------------------------------------------------------------
> ----
>
>
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.308 / Virus Database: 266.10.3 - Release Date: 25/4/2005
|
|
From: <Mat...@Ve...> - 2005-04-26 16:25:42
|
I do agree but my point would be in this case, that the knowledge of language and of algorithm would appear to coincide? -----Original Message----- From: Per Westermark [mailto:pw...@ia...] Sent: Tuesday, April 26, 2005 9:23 AM To: Mat...@Ve... Cc: dan...@st...; mei...@gm...; dev...@li... Subject: RE: [Dev-C++] Function to order elements Not many people know how malloc() works, or how sqrt() is evaluated... qsort() from the C library is (almost) always available and is quite good. C++ also have good sort methods immediately available. I think it is preferable to separate knowledge of algorithms (quick-sort, bubble-sort, heap-sort, ...) from knowledge about a language. /Per W On Tue, 26 Apr 2005 Mat...@Ve... wrote: > I think for a beginner maybe it's a priority that he understand the > algorithm? > > -----Original Message----- > From: dev...@li... > [mailto:dev...@li...]On Behalf Of Per > Westermark > Sent: Tuesday, April 26, 2005 12:09 AM > To: Daniel Pettersson > Cc: Alexsandro Meireles; Dev C++ > Subject: Re: [Dev-C++] Function to order elements > > > No need to ever try bubble-sort except for real desperation in an embedded > system where code space is a premium. There are so many better sort > methods immediately available - several of them already existing in the > normal C/C++ libraries... > > /Per W > > On Mon, 25 Apr 2005, Daniel Pettersson wrote: > > > use bubblesort > > > > http://www.devx.com/vb2themax/Tip/18972 > > > > it works perfect for smaller arrays > > > > > > Alexsandro Meireles wrote: > > > > > Hi, all! > > > > > > Does anyone know any function to order elements? > > > > > > What I need is to pick up a list of numbers like: 1 232 44 5 5 45 5 45 > > > 545 and get an ordered list like 1 5 5 5 44 45 45 232 545, i.e., from > > > the minimum value to the maximum value. > > > > > > Thanks in advance! > > > > > > -- > > > Alexsandro Meireles > > > > > > > > > > ------------------------------------------------------- > > SF email is sponsored by - The IT Product Guide > > Read honest & candid reviews on hundreds of IT Products from real users. > > Discover which products truly live up to the hype. Start reading now. > > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > > _______________________________________________ > > 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 > > > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > 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 > ___________________________________________________________________ > The information contained in this message and any attachment may be > proprietary, confidential, and privileged or subject to the work > product doctrine and thus protected from disclosure. If the reader > of this message is not the intended recipient, or an employee or > agent responsible for delivering this message to the intended > recipient, you are hereby notified that any dissemination, > distribution or copying of this communication is strictly prohibited. > If you have received this communication in error, please notify me > immediately by replying to this message and deleting it and all > copies and backups thereof. Thank you. > |
|
From: Per W. <pw...@ia...> - 2005-04-26 16:23:50
|
Not many people know how malloc() works, or how sqrt() is evaluated... qsort() from the C library is (almost) always available and is quite good. C++ also have good sort methods immediately available. I think it is preferable to separate knowledge of algorithms (quick-sort, bubble-sort, heap-sort, ...) from knowledge about a language. /Per W On Tue, 26 Apr 2005 Mat...@Ve... wrote: > I think for a beginner maybe it's a priority that he understand the > algorithm? > > -----Original Message----- > From: dev...@li... > [mailto:dev...@li...]On Behalf Of Per > Westermark > Sent: Tuesday, April 26, 2005 12:09 AM > To: Daniel Pettersson > Cc: Alexsandro Meireles; Dev C++ > Subject: Re: [Dev-C++] Function to order elements > > > No need to ever try bubble-sort except for real desperation in an embedded > system where code space is a premium. There are so many better sort > methods immediately available - several of them already existing in the > normal C/C++ libraries... > > /Per W > > On Mon, 25 Apr 2005, Daniel Pettersson wrote: > > > use bubblesort > > > > http://www.devx.com/vb2themax/Tip/18972 > > > > it works perfect for smaller arrays > > > > > > Alexsandro Meireles wrote: > > > > > Hi, all! > > > > > > Does anyone know any function to order elements? > > > > > > What I need is to pick up a list of numbers like: 1 232 44 5 5 45 5 45 > > > 545 and get an ordered list like 1 5 5 5 44 45 45 232 545, i.e., from > > > the minimum value to the maximum value. > > > > > > Thanks in advance! > > > > > > -- > > > Alexsandro Meireles > > > > > > > > > > ------------------------------------------------------- > > SF email is sponsored by - The IT Product Guide > > Read honest & candid reviews on hundreds of IT Products from real users. > > Discover which products truly live up to the hype. Start reading now. > > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > > _______________________________________________ > > 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 > > > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > 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 > ___________________________________________________________________ > The information contained in this message and any attachment may be > proprietary, confidential, and privileged or subject to the work > product doctrine and thus protected from disclosure. If the reader > of this message is not the intended recipient, or an employee or > agent responsible for delivering this message to the intended > recipient, you are hereby notified that any dissemination, > distribution or copying of this communication is strictly prohibited. > If you have received this communication in error, please notify me > immediately by replying to this message and deleting it and all > copies and backups thereof. Thank you. > |
|
From: <Mat...@Ve...> - 2005-04-26 16:02:27
|
Yes, it works, but char* is not a very good thing to use any more. It
creates arbitrary limits on lengths that lead to bugs and security problems.
On top of this, you get a minimal performance increase because C++ compilers
and compiler optimization are a great deal better than they used to be not
long ago.
The whole point of C++ is avoiding these issues with generic programming and
classes. Best of all the performance hit is minimal. If you look at
basically every other language in use today besides C, strings are handled
automatically.
GAWK, perl, C++, etc. all do it using string types.
Sometimes it's not good enough for it just to work. There are other factors
to consider.
-----Original Message-----
From: dev...@li...
[mailto:dev...@li...]On Behalf Of Verne H.
Bohlender
Sent: Saturday, February 26, 2005 8:42 AM
To: Dev C++; Rafael Charnovscki
Subject: Re: [Dev-C++] Sentences in a array
The program works fine once you use what comes with Dev C++ and not
substitued the headings. I just clipped the code and used the console
settings and it worked perfectly. Now I'm not sure what he wants it to do
but it gave me no problems at all.
Verne the real amateur at C++
> > Alexsandro Meireles wrote:
>> array[0] = "sentence 1";
>> array[1] = "sentence 2"
>> and so on...
>
> There are some ways I can remember.
> The point is defining your array as
> an array to char pointers.
>
> //initializing an array of strings
> char* sentences[2]={"sentence 1", "sentence 2"};
>
> //assigning strings to the array
> char* sentences[2];
> sentences[0]="another sentence 1";
> sentences[1]="another sentence 2";
>
> /* allocating memory dinamically and copying
> the string */
> strings[0]=(char *)malloc(sentenceLength + 1);
> strcpy(strings[0],"sentence 1 again");
>
> It could be also an bidimensional array of char, but
> I'd rather use pointers:
> char sentences[20][101]; //20 sentences with a limit of 100 characters
>
> Maybe other developers have more suggestions.
> I sent a program (attached) just as an example.
>
> Hope it helps,
> Rafael
>
----------------------------------------------------------------------------
----
> #include <stdlib.h>
> #include <string.h>
>
> int main (){
> //initializing an array of strings
> char* sentences[2]={"sentence 1", "sentence 2"};
> char* strings[2];
> int sentenceLength; //(number of characters of your sentence)
> int i;
> for (i=0;i<2;i++)
> printf("%s\n", sentences[i]);
> system("PAUSE");
> sentences[0]="another sentence 1";
> sentences[1]="another sentence 2";
> for (i=0;i<2;i++)
> printf("%s\n", sentences[i]);
> system("PAUSE");
> sentenceLength = 30; //just an example
> strings[0]=(char *)malloc(sentenceLength + 1);
> strcpy(strings[0],"sentence 1 again");
> sentenceLength = 60; //just an example
> strings[1]=(char *)malloc(sentenceLength + 1);
> strcpy(strings[1],"sentence 2 again");
> for (i=0;i<2;i++)
> printf("%s\n", strings[i]);
> system("PAUSE");
> return 0;
> }
>
>
>
----------------------------------------------------------------------------
----
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.10.3 - Release Date: 25/4/2005
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
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
___________________________________________________________________
The information contained in this message and any attachment may be
proprietary, confidential, and privileged or subject to the work
product doctrine and thus protected from disclosure. If the reader
of this message is not the intended recipient, or an employee or
agent responsible for delivering this message to the intended
recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited.
If you have received this communication in error, please notify me
immediately by replying to this message and deleting it and all
copies and backups thereof. Thank you.
|
|
From: Verne H. B. <ve...@sy...> - 2005-04-26 15:42:09
|
The program works fine once you use what comes with Dev C++ and not
substitued the headings. I just clipped the code and used the console
settings and it worked perfectly. Now I'm not sure what he wants it to do
but it gave me no problems at all.
Verne the real amateur at C++
> > Alexsandro Meireles wrote:
>> array[0] = "sentence 1";
>> array[1] = "sentence 2"
>> and so on...
>
> There are some ways I can remember.
> The point is defining your array as
> an array to char pointers.
>
> //initializing an array of strings
> char* sentences[2]={"sentence 1", "sentence 2"};
>
> //assigning strings to the array
> char* sentences[2];
> sentences[0]="another sentence 1";
> sentences[1]="another sentence 2";
>
> /* allocating memory dinamically and copying
> the string */
> strings[0]=(char *)malloc(sentenceLength + 1);
> strcpy(strings[0],"sentence 1 again");
>
> It could be also an bidimensional array of char, but
> I'd rather use pointers:
> char sentences[20][101]; //20 sentences with a limit of 100 characters
>
> Maybe other developers have more suggestions.
> I sent a program (attached) just as an example.
>
> Hope it helps,
> Rafael
>
--------------------------------------------------------------------------------
> #include <stdlib.h>
> #include <string.h>
>
> int main (){
> //initializing an array of strings
> char* sentences[2]={"sentence 1", "sentence 2"};
> char* strings[2];
> int sentenceLength; //(number of characters of your sentence)
> int i;
> for (i=0;i<2;i++)
> printf("%s\n", sentences[i]);
> system("PAUSE");
> sentences[0]="another sentence 1";
> sentences[1]="another sentence 2";
> for (i=0;i<2;i++)
> printf("%s\n", sentences[i]);
> system("PAUSE");
> sentenceLength = 30; //just an example
> strings[0]=(char *)malloc(sentenceLength + 1);
> strcpy(strings[0],"sentence 1 again");
> sentenceLength = 60; //just an example
> strings[1]=(char *)malloc(sentenceLength + 1);
> strcpy(strings[1],"sentence 2 again");
> for (i=0;i<2;i++)
> printf("%s\n", strings[i]);
> system("PAUSE");
> return 0;
> }
>
>
>
--------------------------------------------------------------------------------
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.10.3 - Release Date: 25/4/2005
|
|
From: <Mat...@Ve...> - 2005-04-26 15:31:55
|
I think for a beginner maybe it's a priority that he understand the algorithm? -----Original Message----- From: dev...@li... [mailto:dev...@li...]On Behalf Of Per Westermark Sent: Tuesday, April 26, 2005 12:09 AM To: Daniel Pettersson Cc: Alexsandro Meireles; Dev C++ Subject: Re: [Dev-C++] Function to order elements No need to ever try bubble-sort except for real desperation in an embedded system where code space is a premium. There are so many better sort methods immediately available - several of them already existing in the normal C/C++ libraries... /Per W On Mon, 25 Apr 2005, Daniel Pettersson wrote: > use bubblesort > > http://www.devx.com/vb2themax/Tip/18972 > > it works perfect for smaller arrays > > > Alexsandro Meireles wrote: > > > Hi, all! > > > > Does anyone know any function to order elements? > > > > What I need is to pick up a list of numbers like: 1 232 44 5 5 45 5 45 > > 545 and get an ordered list like 1 5 5 5 44 45 45 232 545, i.e., from > > the minimum value to the maximum value. > > > > Thanks in advance! > > > > -- > > Alexsandro Meireles > > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > 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 > ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ 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 ___________________________________________________________________ The information contained in this message and any attachment may be proprietary, confidential, and privileged or subject to the work product doctrine and thus protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify me immediately by replying to this message and deleting it and all copies and backups thereof. Thank you. |
|
From: <Mat...@Ve...> - 2005-04-26 15:31:24
|
Yes, using the <string> header, you get a string type. std::string array[50]; array[0]="foo bar baz boo"; array[1]="qux quux quuux quuuux"; ...and so on! The cool thing with string is that they're much easier to deal with than char* . They resize themselves automatically so you don't have to worry about the pointers yourself. HTH! Matt -----Original Message----- From: dev...@li... [mailto:dev...@li...]On Behalf Of Alexsandro Meireles Sent: Monday, April 25, 2005 10:00 PM To: Dev C++ Subject: [Dev-C++] Sentences in a array Hi, dev-c++ users! Do you know if it is possible to put sentences in an array in the following way? array[0] = "sentence 1"; array[1] = "sentence 2" and so on... Any suggestion for this matter, i.e., to put sentences in a array? Tks in advance!!! -- Alexsandro Meireles ___________________________________________________________________ The information contained in this message and any attachment may be proprietary, confidential, and privileged or subject to the work product doctrine and thus protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify me immediately by replying to this message and deleting it and all copies and backups thereof. Thank you. |
|
From: Rafael C. <rc...@un...> - 2005-04-26 14:53:52
|
> Alexsandro Meireles wrote:
> array[0] = "sentence 1";
> array[1] = "sentence 2"
> and so on...
There are some ways I can remember.
The point is defining your array as
an array to char pointers.
//initializing an array of strings
char* sentences[2]={"sentence 1", "sentence 2"};
//assigning strings to the array
char* sentences[2];
sentences[0]="another sentence 1";
sentences[1]="another sentence 2";
/* allocating memory dinamically and copying
the string */
strings[0]=(char *)malloc(sentenceLength + 1);
strcpy(strings[0],"sentence 1 again");
It could be also an bidimensional array of char, but
I'd rather use pointers:
char sentences[20][101]; //20 sentences with a limit of 100 characters
Maybe other developers have more suggestions.
I sent a program (attached) just as an example.
Hope it helps,
Rafael
|
|
From: Daniel P. <dan...@st...> - 2005-04-26 13:06:13
|
Try programmersheaven http://www.programmersheaven.com/ Jay Blanchard wrote: >[snip] >Hi all I'm pretty new in c++ programming. I am finding it very hard to >find >Tutorials on c++ Win32 API. Please HELP its very frustrating... >[/snip] > >Did you Google for C++ Win32 API tutorials? > > >------------------------------------------------------- >SF email is sponsored by - The IT Product Guide >Read honest & candid reviews on hundreds of IT Products from real users. >Discover which products truly live up to the hype. Start reading now. >http://ads.osdn.com/?ad_ide95&alloc_id396&op=click >_______________________________________________ >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: Jay B. <jay...@ni...> - 2005-04-26 11:47:03
|
[snip] Hi all I'm pretty new in c++ programming. I am finding it very hard to find Tutorials on c++ Win32 API. Please HELP its very frustrating...=20 [/snip] Did you Google for C++ Win32 API tutorials? |
|
From: Martin R. <Ma...@cr...> - 2005-04-26 11:38:52
|
Hi all I'm pretty new in c++ programming. I am finding it very hard to find Tutorials on c++ Win32 API. Please HELP its very frustrating...=20 |
|
From: Per W. <pw...@ia...> - 2005-04-26 07:10:26
|
No need to ever try bubble-sort except for real desperation in an embedded system where code space is a premium. There are so many better sort methods immediately available - several of them already existing in the normal C/C++ libraries... /Per W On Mon, 25 Apr 2005, Daniel Pettersson wrote: > use bubblesort > > http://www.devx.com/vb2themax/Tip/18972 > > it works perfect for smaller arrays > > > Alexsandro Meireles wrote: > > > Hi, all! > > > > Does anyone know any function to order elements? > > > > What I need is to pick up a list of numbers like: 1 232 44 5 5 45 5 45 > > 545 and get an ordered list like 1 5 5 5 44 45 45 232 545, i.e., from > > the minimum value to the maximum value. > > > > Thanks in advance! > > > > -- > > Alexsandro Meireles > > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > 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: Alexsandro M. <mei...@gm...> - 2005-04-26 05:00:29
|
Hi, dev-c++ users! Do you know if it is possible to put sentences in an array in the followin= g=20 way? array[0] =3D "sentence 1"; array[1] =3D "sentence 2" and so on... Any suggestion for this matter, i.e., to put sentences in a array? Tks in advance!!! --=20 Alexsandro Meireles |
|
From: Johan H. <joh...@ed...> - 2005-04-25 22:52:07
|
I want to write code like this:
int main(void)
{
blah;
blah;
if (blah)
{
moreblah;
moreblah;
}
}
Earlier, after the last line in a braced segment, I used to hit backspace=
on=20
the next line to take the cursor back to the same indent as the starting=20
brace. My last update of Dev-Cpp (4.9.9.2) doesn't want me to hit backspa=
ce.=20
I should type the closing brace at same indent as the former line. The ed=
itor=20
automatically moves the brace to the starting brace indent level. I have =
a=20
hard time learning this and I really wouldn't mind having it the old way.=
=20
Autoindent is fine, but when the cursor blinks at the wrong indent, I wan=
t to=20
move it myself by hitting backspace. I haven't find settings for this.
--
Johan Halm=E9n
|
|
From: Daniel P. <dan...@st...> - 2005-04-25 22:33:28
|
use bubblesort http://www.devx.com/vb2themax/Tip/18972 it works perfect for smaller arrays Alexsandro Meireles wrote: > Hi, all! > > Does anyone know any function to order elements? > > What I need is to pick up a list of numbers like: 1 232 44 5 5 45 5 45 > 545 and get an ordered list like 1 5 5 5 44 45 45 232 545, i.e., from > the minimum value to the maximum value. > > Thanks in advance! > > -- > Alexsandro Meireles |