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
(11) |
2
(11) |
3
(7) |
4
(20) |
5
(9) |
6
(4) |
|
7
(5) |
8
(22) |
9
(1) |
10
(9) |
11
(1) |
12
(3) |
13
(6) |
|
14
(7) |
15
(8) |
16
(8) |
17
(17) |
18
(8) |
19
(15) |
20
(11) |
|
21
(16) |
22
(19) |
23
(10) |
24
(4) |
25
(12) |
26
(20) |
27
(6) |
|
28
(1) |
29
(3) |
30
|
31
(12) |
|
|
|
|
From: <mi...@ju...> - 2001-10-03 20:05:13
|
Hi, this is my first posting. My question is if you can only use the
system("pause") and system("cls") functions? Is there a way to use good
ol' getch() and clrscr()? And also, are there any other system()
functions? |
|
From: Jason H. <jas...@bt...> - 2001-10-03 13:12:05
|
Hi, I notice you have done three posts so I'll answer them all here as best
I can. I have written a small console app to demonstrate them all too. I
don't know why as I guess that you should be learning this for yourself, but
it was fun for me.
I tried to post this earlier, but it never got through, so this is my second
try.
First of all for a random number you can use rand(). Some compilers provide
a RANDOM() macro, but I don't know about MinGW. It is best to give rand() a
seed using srand(), otherwise you are likely to get the same numbers every
time you run the program. I would use some value you know won't be the same
each time you run a program i.e. the time. To use rand() you need to include
<stdlib.h>; or <cstdlib> if you want to be c++ standard compliant.
To get a single character from a string, either a C string or a C++
std::string, then just use the [] operator with the relevant index. i.e.
char my_string[] = "HELLO";
char c = my_string[4]; // c is now "L"
if you want you can write your own function to do it in the way you want.
I'm not going to do that for you.
As for the sorting of a string in the way you want, I've written an
algorithm that works by going through your string and picking out each of
the letter as it comes to them in order, searching for the same ones and
skipping spaces. Have a look at my code below. There may be a better
algorithm around to do this, but why spend loads of time doing that unless
you are working hundreds of thousands of strings.
Heres my demo, it has been briefly tested and I can't see any great problems
with it:
#include <cstdio> // all around useful header
#include <cstdlib> // the rand() fuction is in this header, so don't forget
it
#include <ctime> // for time()
#include <iostream> // for cout and cin
int main(int argc, char *argv[])
{
using namespace std; // allow implicit use of std namespace
// Random number generation
int num;
srand((unsigned) time(NULL)); // give the rand() function a seed
// I use the time because it's not likely to be the same each time
// the program is run. There may be a better way of doing this?
for(int i = 0; i < 10; ++i)
{
num = (rand() % 99) + 1; // A random number between 1 and 100.
cout << "A random number " << i + 1 << ": " << num << endl;
}
cout << endl;
// Getting a character out of a string
char a_string[] = "This is a string of text. Hello World!";
cout << a_string << endl << "Enter a number between 1 and "
<< sizeof(a_string) - 1 << ": ";
// the string is null terminated, so sizeof reports one bigger
// than text
cin >> num;
cout << "The character at that number is: " << a_string[num-1] << endl;
// You don't need a function to get a single character out of a
string
// just use array access. This applies to std::string too.
// don't forget... arrays are indexed from 0
cout << endl;
// Sorting a string in sequence
char str[80]; // up to 80 chars
cout << "Enter a string to be sorted in sequence (80 char MAX!)"
<< endl << ": ";
gets(str); // get a string from user (part of <cstdio>)
// Begin sort (brute force)
int i = 0, j = 0, k = 0; // index's
char sorted[80], c;
while(str[i])
{
while(str[i] == ' ') ++i; // skip spaces
if(!str[i]) break; // avoid end of line
j = i;
c = str[i];
while(str[j])
{
if(str[j] == c)
{
sorted[k] = c;
str[j] = ' '; // don't get the same char twice
++k; // increment sorted index
}
++j; // increment search index
}
++i; // increment input index
}
sorted[k] = 0; // don't forget to null terminate string!
cout << "Sorted string is: " << sorted << endl;
// NB: there may be a better way to do it, but this works and you
// don't really need anything faster for just 80 chars.
// I leave it to you to perform size and type checking anywhere
system("PAUSE");
return 0;
}
----- Original Message -----
From: "Mansoor Nathani" <man...@sy...>
To: <dev...@li...>
Sent: Wednesday, October 03, 2001 12:12 AM
Subject: [Dev-C++] Help with functions
> Does any one know the functions for :
>
> Generating a random number (integer) between a given range.
>
> Extracting a character from a string: eg:
>
> ( "HELLO", 4 )
>
> that should output the fourth character : L
>
> Any help would be appreciated
>
> Mansoor
>
>
>
>
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|
|
From: <We...@ha...> - 2001-10-03 12:00:57
|
Hi, I'm with a stupid problem! ;) When i open the Dev-C++ in my Win2k, i create a new project or open a project it show me the error: Could not create Code Cinoketion list file What is it ?? How to fix ?? Why it happends?? Thkz. Best Regards. [ ]'s |
|
From: Ioannis V. <no...@ya...> - 2001-10-03 09:57:38
|
I made some ommitions so i resend corrected.
The following code works for ASCII code *only* and for capitals only.
#include <string.h>
/* ... */
int i;
const int appearances[Z]=3D{0};
char buffer[80];
size_t slength;
/* You store the string to buffer here... */=20
slength=3Dstrlen(buffer);
for(i=3D0; i<slength; i++)
appearances[buffer[i]]++;
/* Now you have stored the number of appearances of each letter. */
The most important code was solved, now i guess you can think of
something to sort the letters (sorting function) according to your
criteria.
Ioannis
* Ioannis Vranos
* Programming pages: http://www.noicys.f2s.com
* Alternative URL: http://run.to/noicys
> -----Original Message-----
> From: dev...@li...
> [mailto:dev...@li...] On Behalf=20
> Of Mansoor Nathani
> Sent: Wednesday, October 03, 2001 1:02 AM
> To: dev...@li...
> Subject: [Dev-C++] HELP !
>=20
>=20
> Hi this is my first post to the list
>=20
> I was wondering if someone could please help me out with this problem:
>=20
>=20
> The program should take an input of upto 80 characters and
> sort the characters into order according to the order of=20
> their appearance in the string, skipping spaces. Eg:
> MISSISSIPPI MUD would output: MMIIIISSSSPPUD
>=20
> Any help would be much appreciated..
>=20
> Mansoor Nathani
>=20
>=20
> _______________________________________________
> Dev-cpp-users mailing list Dev...@li...
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>=20
|
|
From: Ioannis V. <no...@ya...> - 2001-10-03 09:54:27
|
Hmm, that *is* boring. I assume C. The following code works for ASCII
code *only* and for capitals only.
#include <string.h>
/* ... */
int i;
const int appearances[Z]=3D{0};
char buffer[80];
size_t slength;
/* You store the string to buffer here... */
slength=3Dstrlen(buffer);
for(i=3D0; i<slength; i++)
appearances[buffer[i]];
/* Now you have stored the number of appearances of each letter. */
The most important code was solved, now i guess you can think of
something to sort the letters (sorting function) according to your
criteria.
Ioannis
* Ioannis Vranos
* Programming pages: http://www.noicys.f2s.com
* Alternative URL: http://run.to/noicys
> -----Original Message-----
> From: dev...@li...=20
> [mailto:dev...@li...] On Behalf=20
> Of Mansoor Nathani
> Sent: Wednesday, October 03, 2001 1:02 AM
> To: dev...@li...
> Subject: [Dev-C++] HELP !
>=20
>=20
> Hi this is my first post to the list
>=20
> I was wondering if someone could please help me out with this problem:
>=20
>=20
> The program should take an input of upto 80 characters and=20
> sort the characters into order according to the order of=20
> their appearance in the string, skipping spaces. Eg:
> MISSISSIPPI MUD would output: MMIIIISSSSPPUD
>=20
> Any help would be much appreciated..
>=20
> Mansoor Nathani
>=20
>=20
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>=20
|
|
From: Ioannis V. <no...@ya...> - 2001-10-03 09:54:25
|
> -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of Mansoor Nathani > Sent: Wednesday, October 03, 2001 1:13 AM > To: dev...@li... > Subject: [Dev-C++] Help with functions > > > Does any one know the functions for : > > Generating a random number (integer) between a given range. #include <stdlib.h> #include <time.h> int x; /* Use this one time anywhere in the program only */ srand(time(NULL)); x=rand(); /* One value between 0 and RAND_MAX, the most (and usually) 32767 */ x=rand(); ... > > Extracting a character from a string: eg: > > ( "HELLO", 4 ) > > that should output the fourth character : L "Hello"[3]; After all literals are const arrays. :) > > Any help would be appreciated > > Mansoor Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.f2s.com * Alternative URL: http://run.to/noicys |
|
From: Ioannis V. <no...@ya...> - 2001-10-03 09:54:25
|
It means no rand() is defined and it makes assumptions. You forgot #include <stdlib.h> Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.f2s.com * Alternative URL: http://run.to/noicys > -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of Mansoor Nathani > Sent: Wednesday, October 03, 2001 1:50 AM > To: dev...@li... > Subject: [Dev-C++] error Msg > > > what does this mean? > > implicit declaration of function `int rand(...)' > > > Mansoor > > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |