dev-cpp-users Mailing List for Dev-C++ (Page 2)
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
|
2
|
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
|
10
|
11
(6) |
12
(3) |
13
(3) |
14
|
15
(1) |
16
(6) |
|
17
|
18
(2) |
19
(3) |
20
(4) |
21
|
22
(2) |
23
(2) |
|
24
(1) |
25
|
26
(7) |
27
(1) |
28
|
29
(6) |
|
|
From: frederico s. <fre...@gm...> - 2008-02-19 11:40:35
|
hi for all
I have one code writed in borland/microsoft visual..
so this programs don't free, and I don't have money for its.
who I do to convert to dec C? (ansi C I presume)
The code import functions from .dll file
here is this:
*C++ Builder / Microsoft Visual C++:*
#ifdef __cplusplus
extern "C" {
#endif
#define *GenUSBDLL * "GenUSB.dll";
/*/ valores retornados pelas funções em GenUSB.DLL:*
#define *NO_ERROR * 0;
#define *DEVICE_NOT_PRESENT *1;
#define *NO_DATA_AVAILABLE *2;
#define *INVALID_BAUDRATE *3;
#define *OVERRUN_ERROR * 4;
#define *INVALID_DATABITS * 5;
#define *INVALID_PARITY * 6;
#define *INVALID_STOPBITS * 7;
*int* __stdcall
*DoGetInfraCode<http://mail.google.com/mail/GenUSB_DLL_help.htm#DoGetInfraCode#DoGetInfraCode>
*(*uchar ** *TimeCodeDiagram*, *int* *DummyInt*, *int ** *DiagramLength*);
*int* __stdcall
*DoSetDataPortDirection<http://mail.google.com/mail/GenUSB_DLL_help.htm#DoSetDataPortDirection#DoSetDataPortDirection>
*(*uchar DirectionByte*);
*int* __stdcall
*DoGetDataPortDirection<http://mail.google.com/mail/GenUSB_DLL_help.htm#DoGetDataPortDirection#DoGetDataPortDirection>
*(*uchar ** *DataDirectionByte*);
*int* __stdcall
*DoSetOutDataPort<http://mail.google.com/mail/GenUSB_DLL_help.htm#DoSetOutDataPort#DoSetOutDataPort>
*(*uchar DataOutByte*);
*int* __stdcall
*DoGetOutDataPort<http://mail.google.com/mail/GenUSB_DLL_help.htm#DoGetOutDataPort#DoGetOutDataPort>
*(*uchar ** *DataOutByte*);
*int* __stdcall
*DoGetInDataPort<http://mail.google.com/mail/GenUSB_DLL_help.htm#DoGetInDataPort#DoGetInDataPort>
*(*uchar ** *DataInByte*);
*int* __stdcall
*DoEEPROMRead<http://mail.google.com/mail/GenUSB_DLL_help.htm#DoEEPROMRead#DoEEPROMRead>
*(*ushort Address*, *uchar ** *DataInByte*);
*int* __stdcall
*DoEEPROMWrite<http://mail.google.com/mail/GenUSB_DLL_help.htm#DoEEPROMWrite#DoEEPROMWrite>
*(*ushort Address*, *uchar DataOutByte*);
*int* __stdcall
*DoRS232Send<http://mail.google.com/mail/GenUSB_DLL_help.htm#DoRS232Send#DoRS232Send>
*(*uchar DataOutByte*);
*int* __stdcall
*DoRS232Read<http://mail.google.com/mail/GenUSB_DLL_help.htm#DoRS232Read#DoRS232Read>
*(*uchar ** *DataInByte*);
*int* __stdcall
*DoSetRS232Baud<http://mail.google.com/mail/GenUSB_DLL_help.htm#DoGetRS232Baud#DoGetRS232Baud>
*(*int BaudRate*);
*int* __stdcall
*DoGetRS232Baud<http://mail.google.com/mail/GenUSB_DLL_help.htm#DoGetRS232Baud#DoGetRS232Baud>
*(*int ** *BaudRate*);
*int* __stdcall
*DoGetRS232Buffer*<http://mail.google.com/mail/GenUSB_DLL_help.htm#DoGetRS232Buffer#DoGetRS232Buffer>
(*uchar ** *RS232Buffer*, *int* *DummyInt*, *int ** *RS232BufferLength*);
*int* __stdcall
*DoRS232BufferSend*<http://mail.google.com/mail/GenUSB_DLL_help.htm#DoRS232BufferSend#DoRS232BufferSend>
(*uchar ** *RS232Buffer*, *int* *DummyInt*, *int ** *RS232BufferLength*);
#ifdef __cplusplus
}
#endif
tankyou for all
|
|
From: Michal M. <mi...@mo...> - 2008-02-18 23:55:52
|
Shawn napsal(a):
> Hi everyone!,
>
> I have this code to overwrite the high score in the highscore.txt file
> in a RPG game that I'm working on for class. I keep getting a 'outfile
> undeclared' fist use this function when it gets to the bolded open file
> for output part. I included #include<fstream> at the beginning. Any
> idea's??
if (playerScore > highScore)
ofstream outfile;
is equivalent to
if (playerScore > highScore)
{
ofstream outfile;
}
so there is no outfile variable after the if statement
> Also, I tried putting curley brakets around after the if statement since
> it's a compound statement block, but then I get this error from dev c++
>
> empty character constant
you did something wrong, this is correct solution:
if (playerScore > highScore)
{
//declare file pointer for input
ofstream outfile;
//Open file for output
outfile.open("highscore.txt", ios::out);
//write data
outfile<<playerName<<playerScore<<endl;
//close file
outfile.close();
}
|
|
From: Shawn <tre...@gm...> - 2008-02-18 22:04:19
|
Hi everyone!,
I have this code to overwrite the high score in the highscore.txt file
in a RPG game that I'm working on for class. I keep getting a 'outfile
undeclared' fist use this function when it gets to the bolded open file
for output part. I included #include<fstream> at the beginning. Any
idea's??
Also, I tried putting curley brakets around after the if statement since
it's a compound statement block, but then I get this error from dev c++
empty character constant
thx!
//Write player's high score if greater then score in txt file
//declare file pointer for input
ifstream infile;
//declare variables
string fileName = "";
int highScore = 0;
//Open file for input
infile.open("highscore.txt", ios::in);
//read in data
getline(infile, fileName);
infile>>highScore;
//Close file
infile.close();
if (playerScore > highScore)
//declare file pointer for input
ofstream outfile;
*//Open file for output
outfile.open("highscore.txt", ios::out);*
//write data
outfile<<playerName<<playerScore<<endl;
//close file
outfile.close();
|
|
From: Per W. <pw...@ia...> - 2008-02-16 23:00:36
|
M$ has their own ways. They want you to install more software on your machine. In their hurry to do that, they don't care too much about different web browsers - after all, they have IE... /pwm On Sun, 17 Feb 2008, Eric wrote: > I dont belive this > > When I click on the link from the Email ptogram Internet explorer comes up > with a blank page. (with only header) > When I go with firefox 2.0.0.12 via google part of the text is covered over > by a big grey patch > Opera 9.25 works fine, no problem. > > > ----- Original Message ----- > From: Per Westermark <pw...@ia...> > To: Eric <er...@du...> > Cc: <dev...@li...> > Sent: Saturday, February 16, 2008 2:17 PM > Subject: Re: [Dev-C++] delay function in dev > > > The link seems find. However, have you tried to google for "MSDN Sleep"? > > /pwm > > On Sun, 17 Feb 2008, Eric wrote: > > > I can not get this link to work > > http://msdn2.microsoft.com/en-us/library/ms686298(VS.85).aspx > > > > > > > > > > > > > > > > ----- Original Message ----- > > From: Per Westermark <pw...@ia...> > > To: frederico schardong <fre...@gm...> > > Cc: <dev...@li...> > > Sent: Saturday, February 16, 2008 1:17 PM > > Subject: Re: [Dev-C++] delay function in dev > > > > > > Dev-C++ targets Windows. > > > > Besides the normal C library functions (which you can find documentation > > for on the GNU home page), you also have all Win32 API. For documentation > > about them, you can visit the Microsoft MSDN web site. > > > > Then, there is also a bit of documentation together with the MinGW > > compiler. > > > > For Sleep(), see: > > http://msdn2.microsoft.com/en-us/library/ms686298(VS.85).aspx > > > > /pwm > > > > EMA System email: pw...@ia... > > Per Westermark web: http://iapetus.neab.net > > Vargvaegen 174B phone: +46 70 214 74 48 > > S-906 42 Umeaa > > Sweden > > > > > > On Sat, 16 Feb 2008, frederico schardong wrote: > > > > > Hello! > > > > > > I must create a delay in one of my programs. it's written on ANSI C. > > > > > > This delay must be 3 mileseconds (the time is ir irrelevant) > > > > > > I find delay function in ccs compiler for PIC family > > > > > > I must know which library I have use to use delay function in DEV > compiler > > > > > > tanks > > > > > > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by: Microsoft > > Defy all challenges. Microsoft(R) Visual Studio 2008. > > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > _______________________________________________ > > 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 > > > > > > -- > > No virus found in this incoming message. > > Checked by AVG Free Edition. > > Version: 7.5.516 / Virus Database: 269.20.7/1283 - Release Date: 2/16/08 > > 2:16 PM > > > > > > > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by: Microsoft > > Defy all challenges. Microsoft(R) Visual Studio 2008. > > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > _______________________________________________ > > 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 > > > > > > -- > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.5.516 / Virus Database: 269.20.7/1283 - Release Date: 2/16/08 > 2:16 PM > > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > 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: Eric <eri...@wo...> - 2008-02-16 22:56:08
|
I dont belive this When I click on the link from the Email ptogram Internet explorer comes up with a blank page. (with only header) When I go with firefox 2.0.0.12 via google part of the text is covered over by a big grey patch Opera 9.25 works fine, no problem. ----- Original Message ----- From: Per Westermark <pw...@ia...> To: Eric <er...@du...> Cc: <dev...@li...> Sent: Saturday, February 16, 2008 2:17 PM Subject: Re: [Dev-C++] delay function in dev The link seems find. However, have you tried to google for "MSDN Sleep"? /pwm On Sun, 17 Feb 2008, Eric wrote: > I can not get this link to work > http://msdn2.microsoft.com/en-us/library/ms686298(VS.85).aspx > > > > > > > > ----- Original Message ----- > From: Per Westermark <pw...@ia...> > To: frederico schardong <fre...@gm...> > Cc: <dev...@li...> > Sent: Saturday, February 16, 2008 1:17 PM > Subject: Re: [Dev-C++] delay function in dev > > > Dev-C++ targets Windows. > > Besides the normal C library functions (which you can find documentation > for on the GNU home page), you also have all Win32 API. For documentation > about them, you can visit the Microsoft MSDN web site. > > Then, there is also a bit of documentation together with the MinGW > compiler. > > For Sleep(), see: > http://msdn2.microsoft.com/en-us/library/ms686298(VS.85).aspx > > /pwm > > EMA System email: pw...@ia... > Per Westermark web: http://iapetus.neab.net > Vargvaegen 174B phone: +46 70 214 74 48 > S-906 42 Umeaa > Sweden > > > On Sat, 16 Feb 2008, frederico schardong wrote: > > > Hello! > > > > I must create a delay in one of my programs. it's written on ANSI C. > > > > This delay must be 3 mileseconds (the time is ir irrelevant) > > > > I find delay function in ccs compiler for PIC family > > > > I must know which library I have use to use delay function in DEV compiler > > > > tanks > > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > 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 > > > -- > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.5.516 / Virus Database: 269.20.7/1283 - Release Date: 2/16/08 > 2:16 PM > > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > 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 > -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.516 / Virus Database: 269.20.7/1283 - Release Date: 2/16/08 2:16 PM |
|
From: Per W. <pw...@ia...> - 2008-02-16 22:18:00
|
The link seems find. However, have you tried to google for "MSDN Sleep"? /pwm On Sun, 17 Feb 2008, Eric wrote: > I can not get this link to work > http://msdn2.microsoft.com/en-us/library/ms686298(VS.85).aspx > > > > > > > > ----- Original Message ----- > From: Per Westermark <pw...@ia...> > To: frederico schardong <fre...@gm...> > Cc: <dev...@li...> > Sent: Saturday, February 16, 2008 1:17 PM > Subject: Re: [Dev-C++] delay function in dev > > > Dev-C++ targets Windows. > > Besides the normal C library functions (which you can find documentation > for on the GNU home page), you also have all Win32 API. For documentation > about them, you can visit the Microsoft MSDN web site. > > Then, there is also a bit of documentation together with the MinGW > compiler. > > For Sleep(), see: > http://msdn2.microsoft.com/en-us/library/ms686298(VS.85).aspx > > /pwm > > EMA System email: pw...@ia... > Per Westermark web: http://iapetus.neab.net > Vargvaegen 174B phone: +46 70 214 74 48 > S-906 42 Umeaa > Sweden > > > On Sat, 16 Feb 2008, frederico schardong wrote: > > > Hello! > > > > I must create a delay in one of my programs. it's written on ANSI C. > > > > This delay must be 3 mileseconds (the time is ir irrelevant) > > > > I find delay function in ccs compiler for PIC family > > > > I must know which library I have use to use delay function in DEV compiler > > > > tanks > > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > 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 > > > -- > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.5.516 / Virus Database: 269.20.7/1283 - Release Date: 2/16/08 > 2:16 PM > > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > 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: Eric <eri...@wo...> - 2008-02-16 21:53:08
|
I can not get this link to work http://msdn2.microsoft.com/en-us/library/ms686298(VS.85).aspx ----- Original Message ----- From: Per Westermark <pw...@ia...> To: frederico schardong <fre...@gm...> Cc: <dev...@li...> Sent: Saturday, February 16, 2008 1:17 PM Subject: Re: [Dev-C++] delay function in dev Dev-C++ targets Windows. Besides the normal C library functions (which you can find documentation for on the GNU home page), you also have all Win32 API. For documentation about them, you can visit the Microsoft MSDN web site. Then, there is also a bit of documentation together with the MinGW compiler. For Sleep(), see: http://msdn2.microsoft.com/en-us/library/ms686298(VS.85).aspx /pwm EMA System email: pw...@ia... Per Westermark web: http://iapetus.neab.net Vargvaegen 174B phone: +46 70 214 74 48 S-906 42 Umeaa Sweden On Sat, 16 Feb 2008, frederico schardong wrote: > Hello! > > I must create a delay in one of my programs. it's written on ANSI C. > > This delay must be 3 mileseconds (the time is ir irrelevant) > > I find delay function in ccs compiler for PIC family > > I must know which library I have use to use delay function in DEV compiler > > tanks > ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ 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 -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.516 / Virus Database: 269.20.7/1283 - Release Date: 2/16/08 2:16 PM |
|
From: Per W. <pw...@ia...> - 2008-02-16 21:17:36
|
Dev-C++ targets Windows. Besides the normal C library functions (which you can find documentation for on the GNU home page), you also have all Win32 API. For documentation about them, you can visit the Microsoft MSDN web site. Then, there is also a bit of documentation together with the MinGW compiler. For Sleep(), see: http://msdn2.microsoft.com/en-us/library/ms686298(VS.85).aspx /pwm EMA System email: pw...@ia... Per Westermark web: http://iapetus.neab.net Vargvaegen 174B phone: +46 70 214 74 48 S-906 42 Umeaa Sweden On Sat, 16 Feb 2008, frederico schardong wrote: > Hello! > > I must create a delay in one of my programs. it's written on ANSI C. > > This delay must be 3 mileseconds (the time is ir irrelevant) > > I find delay function in ccs compiler for PIC family > > I must know which library I have use to use delay function in DEV compiler > > tanks > |
|
From: frederico s. <fre...@gm...> - 2008-02-16 21:11:42
|
Hello! I must create a delay in one of my programs. it's written on ANSI C. This delay must be 3 mileseconds (the time is ir irrelevant) I find delay function in ccs compiler for PIC family I must know which library I have use to use delay function in DEV compiler tanks |
|
From: Robert C. <cra...@gm...> - 2008-02-15 20:57:02
|
Dev...@li... |
|
From: Shawn <tre...@gm...> - 2008-02-13 14:09:46
|
Thanks everyone!
:)
Mayank Jain Nawal wrote:
> Dear
>
> There is no problem with the bool data type. In the below code
> comparison operator has been used instead of assignment operator for
> changing the value of output variable. So in the below code value of
> output variable is never changed to false and during the conditional
> checking in the if statement it get its value as true.
>
>
>
>> ------------------------------
>>
>> Message: 2
>> Date: Tue, 12 Feb 2008 00:03:54 -0500
>> From: Shawn <tre...@gm...>
>> Subject: Re: [Dev-C++] bool data type
>> To: ll...@cd...
>> Cc: dev...@li...
>> Message-ID: <47B...@gm...>
>> Content-Type: text/plain; charset="iso-8859-1"
>>
>> I'm working with C++ though, my book says that the bool data type is
>> a built-in type consisting of just two values, the constants true and
>> false.
>> I have the program compiling without error now, however, it still
>> prints the last statement even though I didn't enter valid data.
>> int main()
>> {
>>
>> //Declare and initialize variables
>> float weight = 0.0;
>> float distance = 0.0;
>> float shippingRate = 0.0;
>> float shippingCharges = 0.0;
>> * bool output = true;*
>>
>>
>> //Intro
>> cout<<endl;
>> cout<<"Thank you for shipping with The Fast Freight Company!!!\n\n";
>>
>>
>> //Prompt user for the weight of their package
>> cout<<"Please enter the weight of your pacakge(in grams): ";
>> cin>>weight;
>> cout<<endl;
>> if (weight <= 0 || weight > 20000)
>> {cout<<"Please enter either a positive number or a weight of 20
>> kilograms or less for your package.\t\t";
>> *output == false;*} //use = sign here **instead of ==**
>>
>> //Prompt user for distance the package will travel
>> cout<<"Please enter the distance the package will travel(in miles): ";
>> cin>>distance;
>> cout<<endl;
>> if (distance < 10 || distance > 3000)
>> {cout<<"We don't ship to distances of less then 10 miles or more
>> then 3000 miles.\t\t";
>> * *output == false;*} // use = sign here instead of ==*
>>
>>
>> //Evaluate weight input
>> if (weight <= 2000)
>> shippingRate = 1.10;
>> else if (weight > 2000 && weight <= 6000)
>> shippingRate = 2.20;
>> else if (weight > 6000 && weight <= 10000)
>> shippingRate = 3.70;
>> else
>> shippingRate = 4.80;
>>
>> //Evaluate distance input
>> if (distance >= 10 && distance <= 500)
>> distance = 500;
>> else if (distance >= 501 && distance <=1000)
>> distance = 1000;
>> else if (distance >= 1001 && distance <= 1500)
>> distance = 1500;
>> else if (distance >= 1501 && distance <= 2000)
>> distance = 2000;
>> else if (distance >= 2001 && distance <= 2500)
>> distance = 2500;
>> else
>> distance = 3000;
>> //Perform the calculations shippingCharges =
>> shippingRate * (distance/500);
>> //Evaluate if output is needed
>> //if (weight > 0 && weight <= 20000 && distance >= 10 && distance <=
>> 3000)
>> *if (output == true) *
>> //Output shipping charges
>> {cout<<fixed<<showpoint;
>> cout<<"The total shipping charges for your package is
>> $"<<setprecision(2)<<shippingCharges<<endl;}
>>
>> return 0;
>> }
>>
>> When I enter 0 for both or just one prompt, the program still
>> displays both the total shipping charges as $6.60 and the input
>> validation message.
>> When I uncomment out the *if (weight > 0 && weight <= 20000 &&
>> distance >= 10 && distance <= 3000) *line, it works just fine so I
>> have to be using bool wrong somehow.
>>
>> Lloyd wrote:
>>
>>> //C does not have bool data type
>>> enum
>>> {
>>> FALSE=0,
>>> TRUE=1
>>> };
>>>
>>> typedef int bool;
>>>
>>> int main()
>>> {
>>> bool a=TRUE;
>>> }
>>>
>>>
>>> On Mon, 2008-02-11 at 18:36 -0500, Shawn wrote:
>>>
>>>> Thanks, but the compiler is still saying 'TRUE' undeclared (first use
>>>> this function) and points me to the line where I initialize it to TRUE
>>>> at the beginning of my program.
>>>> bool output = TRUE;
>>>>
>>>> I thought that as soon as you call bool, the compiler knows it's
>>>> either going to be true or false?
>>>> pepone.onrez wrote:
>>>>> dev...@li...
>>>>>
>>>>> On Feb 12, 2008 12:09 AM, Shawn <tre...@gm...> wrote:>
>>>>>
>>>>>> but then what would I put just before the total shipping charges
>>>>>>
>>>>> line so it wouldn't print?
>>>>> if(output == TRUE){
>>>>> //output is TRUE to what you whan
>>>>> }else{
>>>>>
>>>>>
>>>>> }
>>>>>
>>>>> -------------------------------------------------------------------------
>>>>>
>>>>> This SF.net email is sponsored by: Microsoft
>>>>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>>>>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>>>>> _______________________________________________
>>>>> 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
>>>>>
>>>>>
>>>>> ____________________________________________________________________
>>>>>
>>>>> -------------------------------------------------------------------------
>>>>>
>>>>> This SF.net email is sponsored by: Microsoft
>>>>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>>>>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>>>>>
>>>>> ____________________________________________________________________
>>>>>
>>>>> _______________________________________________
>>>>> 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
>>>>>
>>>> -------------------------------------------------------------------------
>>>>
>>>> This SF.net email is sponsored by: Microsoft
>>>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>>>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>>>> _______________________________________________ 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
>>>>
>>> ______________________________________
>>> Scanned and protected by Email scanner
>>>
>>> -------------------------------------------------------------------------
>>>
>>> This SF.net email is sponsored by: Microsoft
>>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>>> _______________________________________________
>>> 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: Mayank J. N. <ma...@in...> - 2008-02-13 11:59:08
|
Dear
There is no problem with the bool data type. In the below code
comparison operator has been used instead of assignment operator for
changing the value of output variable. So in the below code value of
output variable is never changed to false and during the conditional
checking in the if statement it get its value as true.
> ------------------------------
>
> Message: 2
> Date: Tue, 12 Feb 2008 00:03:54 -0500
> From: Shawn <tre...@gm...>
> Subject: Re: [Dev-C++] bool data type
> To: ll...@cd...
> Cc: dev...@li...
> Message-ID: <47B...@gm...>
> Content-Type: text/plain; charset="iso-8859-1"
>
> I'm working with C++ though, my book says that the bool data type is a
> built-in type consisting of just two values, the constants true and false.
>
> I have the program compiling without error now, however, it still prints
> the last statement even though I didn't enter valid data.
>
> int main()
> {
>
> //Declare and initialize variables
> float weight = 0.0;
> float distance = 0.0;
> float shippingRate = 0.0;
> float shippingCharges = 0.0;
> * bool output = true;*
>
>
> //Intro
> cout<<endl;
> cout<<"Thank you for shipping with The Fast Freight Company!!!\n\n";
>
>
> //Prompt user for the weight of their package
> cout<<"Please enter the weight of your pacakge(in grams): ";
> cin>>weight;
> cout<<endl;
> if (weight <= 0 || weight > 20000)
> {cout<<"Please enter either a positive number or a weight of 20
> kilograms or less for your package.\t\t";
> *output == false;*} //use = sign here **instead of ==**
>
> //Prompt user for distance the package will travel
> cout<<"Please enter the distance the package will travel(in miles): ";
> cin>>distance;
> cout<<endl;
> if (distance < 10 || distance > 3000)
> {cout<<"We don't ship to distances of less then 10 miles or more
> then 3000 miles.\t\t";
> * *output == false;*} // use = sign here instead of ==*
>
>
> //Evaluate weight input
> if (weight <= 2000)
> shippingRate = 1.10;
> else if (weight > 2000 && weight <= 6000)
> shippingRate = 2.20;
> else if (weight > 6000 && weight <= 10000)
> shippingRate = 3.70;
> else
> shippingRate = 4.80;
>
>
> //Evaluate distance input
> if (distance >= 10 && distance <= 500)
> distance = 500;
> else if (distance >= 501 && distance <=1000)
> distance = 1000;
> else if (distance >= 1001 && distance <= 1500)
> distance = 1500;
> else if (distance >= 1501 && distance <= 2000)
> distance = 2000;
> else if (distance >= 2001 && distance <= 2500)
> distance = 2500;
> else
> distance = 3000;
>
>
> //Perform the calculations
> shippingCharges = shippingRate * (distance/500);
>
> //Evaluate if output is needed
> //if (weight > 0 && weight <= 20000 && distance >= 10 && distance <= 3000)
> *if (output == true) *
> //Output shipping charges
> {cout<<fixed<<showpoint;
> cout<<"The total shipping charges for your package is
> $"<<setprecision(2)<<shippingCharges<<endl;}
>
> return 0;
> }
>
> When I enter 0 for both or just one prompt, the program still displays
> both the total shipping charges as $6.60 and the input validation message.
>
> When I uncomment out the *if (weight > 0 && weight <= 20000 && distance
> >= 10 && distance <= 3000) *line, it works just fine so I have to be
> using bool wrong somehow.
>
> Lloyd wrote:
>
>> //C does not have bool data type
>> enum
>> {
>> FALSE=0,
>> TRUE=1
>> };
>>
>> typedef int bool;
>>
>> int main()
>> {
>> bool a=TRUE;
>> }
>>
>>
>> On Mon, 2008-02-11 at 18:36 -0500, Shawn wrote:
>>
>>
>>> Thanks, but the compiler is still saying 'TRUE' undeclared (first use
>>> this function) and points me to the line where I initialize it to TRUE
>>> at the beginning of my program.
>>>
>>> bool output = TRUE;
>>>
>>> I thought that as soon as you call bool, the compiler knows it's
>>> either going to be true or false?
>>>
>>> pepone.onrez wrote:
>>>
>>>
>>>> dev...@li...
>>>>
>>>> On Feb 12, 2008 12:09 AM, Shawn <tre...@gm...> wrote:>
>>>>
>>>>
>>>>> but then what would I put just before the total shipping charges
>>>>>
>>>>>
>>>> line so it wouldn't print?
>>>> if(output == TRUE){
>>>> //output is TRUE to what you whan
>>>> }else{
>>>>
>>>>
>>>> }
>>>>
>>>> -------------------------------------------------------------------------
>>>> This SF.net email is sponsored by: Microsoft
>>>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>>>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>>>> _______________________________________________
>>>> 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
>>>>
>>>>
>>>> ____________________________________________________________________
>>>>
>>>> -------------------------------------------------------------------------
>>>> This SF.net email is sponsored by: Microsoft
>>>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>>>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>>>>
>>>> ____________________________________________________________________
>>>>
>>>> _______________________________________________
>>>> 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
>>>>
>>>>
>>>>
>>> -------------------------------------------------------------------------
>>> This SF.net email is sponsored by: Microsoft
>>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>>> _______________________________________________ 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
>>>
>>>
>> ______________________________________
>> Scanned and protected by Email scanner
>>
>> -------------------------------------------------------------------------
>> This SF.net email is sponsored by: Microsoft
>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>> _______________________________________________
>> 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
>>
>>
>>
--
_____________________________________________________________
Mayank Jain Nawal NIKSUN.
ma...@in... http://www.niksun.com
Tel: +91 124 231 6012 SCO 16 Sector 14
Mob: +91 981 839 0836 Gurgaon Haryana 122001 India
_____________________________________________________________
|
|
From: Abilash S. M. <abi...@wi...> - 2008-02-13 09:11:17
|
Hi,
Looks like u intended
output = false
instead of
output == false
The reason why you always get the o/p is because only true assignment
statement was
bool output = true;
So the variable is always true and you always get the output.
Abilash Sankar Mohan
_____
From: dev...@li...
[mailto:dev...@li...] On Behalf Of Shawn
Sent: Tuesday, February 12, 2008 10:34 AM
To: ll...@cd...
Cc: dev...@li...
Subject: Re: [Dev-C++] bool data type
I'm working with C++ though, my book says that the bool data type is a
built-in type consisting of just two values, the constants true and false.
I have the program compiling without error now, however, it still prints the
last statement even though I didn't enter valid data.
int main()
{
//Declare and initialize variables
float weight = 0.0;
float distance = 0.0;
float shippingRate = 0.0;
float shippingCharges = 0.0;
bool output = true;
//Intro
cout<<endl;
cout<<"Thank you for shipping with The Fast Freight Company!!!\n\n";
//Prompt user for the weight of their package
cout<<"Please enter the weight of your pacakge(in grams): ";
cin>>weight;
cout<<endl;
if (weight <= 0 || weight > 20000)
{cout<<"Please enter either a positive number or a weight of 20
kilograms or less for your package.\t\t";
output == false;}
//Prompt user for distance the package will travel
cout<<"Please enter the distance the package will travel(in miles): ";
cin>>distance;
cout<<endl;
if (distance < 10 || distance > 3000)
{cout<<"We don't ship to distances of less then 10 miles or more then
3000 miles.\t\t";
output == false;}
//Evaluate weight input
if (weight <= 2000)
shippingRate = 1.10;
else if (weight > 2000 && weight <= 6000)
shippingRate = 2.20;
else if (weight > 6000 && weight <= 10000)
shippingRate = 3.70;
else
shippingRate = 4.80;
//Evaluate distance input
if (distance >= 10 && distance <= 500)
distance = 500;
else if (distance >= 501 && distance <=1000)
distance = 1000;
else if (distance >= 1001 && distance <= 1500)
distance = 1500;
else if (distance >= 1501 && distance <= 2000)
distance = 2000;
else if (distance >= 2001 && distance <= 2500)
distance = 2500;
else
distance = 3000;
//Perform the calculations
shippingCharges = shippingRate * (distance/500);
//Evaluate if output is needed
//if (weight > 0 && weight <= 20000 && distance >= 10 && distance <= 3000)
if (output == true)
//Output shipping charges
{cout<<fixed<<showpoint;
cout<<"The total shipping charges for your package is
$"<<setprecision(2)<<shippingCharges<<endl;}
return 0;
}
When I enter 0 for both or just one prompt, the program still displays both
the total shipping charges as $6.60 and the input validation message.
When I uncomment out the if (weight > 0 && weight <= 20000 && distance >= 10
&& distance <= 3000) line, it works just fine so I have to be using bool
wrong somehow.
Lloyd wrote:
//C does not have bool data type
enum
{
FALSE=0,
TRUE=1
};
typedef int bool;
int main()
{
bool a=TRUE;
}
On Mon, 2008-02-11 at 18:36 -0500, Shawn wrote:
Thanks, but the compiler is still saying 'TRUE' undeclared (first use
this function) and points me to the line where I initialize it to TRUE
at the beginning of my program.
bool output = TRUE;
I thought that as soon as you call bool, the compiler knows it's
either going to be true or false?
pepone.onrez wrote:
dev...@li...
On Feb 12, 2008 12:09 AM, Shawn <mailto:tre...@gm...>
<tre...@gm...> wrote:>
but then what would I put just before the total shipping charges
line so it wouldn't print?
if(output == TRUE){
//output is TRUE to what you whan
}else{
}
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
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
____________________________________________________________________
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
____________________________________________________________________
_______________________________________________
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
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________ 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
______________________________________
Scanned and protected by Email scanner
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
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: frederico s. <fre...@gm...> - 2008-02-12 17:37:31
|
Hello! I'm novice here. I from Brazil I have 16 years old nice day by |
|
From: Shawn <tre...@gm...> - 2008-02-12 05:04:00
|
I'm working with C++ though, my book says that the bool data type is a
built-in type consisting of just two values, the constants true and false.
I have the program compiling without error now, however, it still prints
the last statement even though I didn't enter valid data.
int main()
{
//Declare and initialize variables
float weight = 0.0;
float distance = 0.0;
float shippingRate = 0.0;
float shippingCharges = 0.0;
* bool output = true;*
//Intro
cout<<endl;
cout<<"Thank you for shipping with The Fast Freight Company!!!\n\n";
//Prompt user for the weight of their package
cout<<"Please enter the weight of your pacakge(in grams): ";
cin>>weight;
cout<<endl;
if (weight <= 0 || weight > 20000)
{cout<<"Please enter either a positive number or a weight of 20
kilograms or less for your package.\t\t";
*output == false;*}
//Prompt user for distance the package will travel
cout<<"Please enter the distance the package will travel(in miles): ";
cin>>distance;
cout<<endl;
if (distance < 10 || distance > 3000)
{cout<<"We don't ship to distances of less then 10 miles or more
then 3000 miles.\t\t";
*output == false;*}
//Evaluate weight input
if (weight <= 2000)
shippingRate = 1.10;
else if (weight > 2000 && weight <= 6000)
shippingRate = 2.20;
else if (weight > 6000 && weight <= 10000)
shippingRate = 3.70;
else
shippingRate = 4.80;
//Evaluate distance input
if (distance >= 10 && distance <= 500)
distance = 500;
else if (distance >= 501 && distance <=1000)
distance = 1000;
else if (distance >= 1001 && distance <= 1500)
distance = 1500;
else if (distance >= 1501 && distance <= 2000)
distance = 2000;
else if (distance >= 2001 && distance <= 2500)
distance = 2500;
else
distance = 3000;
//Perform the calculations
shippingCharges = shippingRate * (distance/500);
//Evaluate if output is needed
//if (weight > 0 && weight <= 20000 && distance >= 10 && distance <= 3000)
*if (output == true) *
//Output shipping charges
{cout<<fixed<<showpoint;
cout<<"The total shipping charges for your package is
$"<<setprecision(2)<<shippingCharges<<endl;}
return 0;
}
When I enter 0 for both or just one prompt, the program still displays
both the total shipping charges as $6.60 and the input validation message.
When I uncomment out the *if (weight > 0 && weight <= 20000 && distance
>= 10 && distance <= 3000) *line, it works just fine so I have to be
using bool wrong somehow.
Lloyd wrote:
> //C does not have bool data type
> enum
> {
> FALSE=0,
> TRUE=1
> };
>
> typedef int bool;
>
> int main()
> {
> bool a=TRUE;
> }
>
>
> On Mon, 2008-02-11 at 18:36 -0500, Shawn wrote:
>
>> Thanks, but the compiler is still saying 'TRUE' undeclared (first use
>> this function) and points me to the line where I initialize it to TRUE
>> at the beginning of my program.
>>
>> bool output = TRUE;
>>
>> I thought that as soon as you call bool, the compiler knows it's
>> either going to be true or false?
>>
>> pepone.onrez wrote:
>>
>>> dev...@li...
>>>
>>> On Feb 12, 2008 12:09 AM, Shawn <tre...@gm...> wrote:>
>>>
>>>> but then what would I put just before the total shipping charges
>>>>
>>> line so it wouldn't print?
>>> if(output == TRUE){
>>> //output is TRUE to what you whan
>>> }else{
>>>
>>>
>>> }
>>>
>>> -------------------------------------------------------------------------
>>> This SF.net email is sponsored by: Microsoft
>>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>>> _______________________________________________
>>> 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
>>>
>>>
>>> ____________________________________________________________________
>>>
>>> -------------------------------------------------------------------------
>>> This SF.net email is sponsored by: Microsoft
>>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>>>
>>> ____________________________________________________________________
>>>
>>> _______________________________________________
>>> 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
>>>
>>>
>> -------------------------------------------------------------------------
>> This SF.net email is sponsored by: Microsoft
>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>> _______________________________________________ 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
>>
>
>
> ______________________________________
> Scanned and protected by Email scanner
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> 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: Lloyd <ll...@cd...> - 2008-02-12 03:25:07
|
//C does not have bool data type
enum
{
FALSE=0,
TRUE=1
};
typedef int bool;
int main()
{
bool a=TRUE;
}
On Mon, 2008-02-11 at 18:36 -0500, Shawn wrote:
> Thanks, but the compiler is still saying 'TRUE' undeclared (first use
> this function) and points me to the line where I initialize it to TRUE
> at the beginning of my program.
>
> bool output = TRUE;
>
> I thought that as soon as you call bool, the compiler knows it's
> either going to be true or false?
>
> pepone.onrez wrote:
> > dev...@li...
> >
> > On Feb 12, 2008 12:09 AM, Shawn <tre...@gm...> wrote:>
> > >but then what would I put just before the total shipping charges
> > line so it wouldn't print?
> > if(output == TRUE){
> > //output is TRUE to what you whan
> > }else{
> >
> >
> > }
> >
> > -------------------------------------------------------------------------
> > This SF.net email is sponsored by: Microsoft
> > Defy all challenges. Microsoft(R) Visual Studio 2008.
> > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> > _______________________________________________
> > 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
> >
> >
> > ____________________________________________________________________
> >
> > -------------------------------------------------------------------------
> > This SF.net email is sponsored by: Microsoft
> > Defy all challenges. Microsoft(R) Visual Studio 2008.
> > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> >
> > ____________________________________________________________________
> >
> > _______________________________________________
> > 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
> >
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________ 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
______________________________________
Scanned and protected by Email scanner
|
|
From: Shawn <tre...@gm...> - 2008-02-11 23:37:03
|
Thanks, but the compiler is still saying 'TRUE' undeclared (first use
this function) and points me to the line where I initialize it to TRUE
at the beginning of my program.
bool output = TRUE;
I thought that as soon as you call bool, the compiler knows it's either
going to be true or false?
pepone.onrez wrote:
> dev...@li...
> <mailto:dev...@li...>
>
> On Feb 12, 2008 12:09 AM, Shawn <tre...@gm...
> <mailto:tre...@gm...>> wrote:>
> >but then what would I put just before the total shipping charges line
> so it wouldn't print?
> if(output == TRUE){
> //output is TRUE to what you whan
> }else{
>
>
>
> }
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> <mailto:Dev...@li...>
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
>
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> ------------------------------------------------------------------------
>
> _______________________________________________
> 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: pepone.onrez <pep...@gm...> - 2008-02-11 23:20:53
|
dev...@li...
On Feb 12, 2008 12:09 AM, Shawn <tre...@gm...> wrote:>
>but then what would I put just before the total shipping charges line so it
wouldn't print?
if(output == TRUE){
//output is TRUE to what you whan
}else{
> }
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> 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: Shawn <tre...@gm...> - 2008-02-11 23:10:12
|
This is the first time that I'm trying to use C's build in data type for
true/false and I'm having some problems.
Basically, I'm trying to use bool to keep the program from displaying
results if invalid data is entered.
if (weight <= 0 || weight > 20000)
cout<<"Please enter either a positive number or a weight of 20
kilograms or less for your package.\t\t";
if (distance < 10 || distance > 3000)
cout<<"We don't ship to distances of less then 10 miles or more then
3000 miles.\t\t";
If this is the case and they do enter invalid data, I want bool to stop
the output of the program from printing on screen, I just want the
program to tell the user that they need to enter the right information
as prompted above.
cout<<"The total shipping charges for your package is
$"<<setprecision(2)<<shippingCharges<<endl;
What's the best way to go about this? I was thinking of declaring bool
output = True in the beginning of the program and then right after those
two input validation statements set output = false, but then what would
I put just before the total shipping charges line so it wouldn't print?
Also, I'm having problems setting output = false, it says false is
undeclared. I thought bool was a built in true/false data type?
thx
|
|
From: rodolfo d'E. <rod...@ho...> - 2008-02-11 05:25:09
|
Hi,
There is a Windows Api function called Sleep :
Declare:
//sleep
Subroutine Sleep( long dwMilliseconds ) Library "kernel32.dll"
Execution:
//sleep process for 1 second
Sleep(1000)
Notice the capital S in Sleep.
Cheers
Rodolfo d'Ettorre
________________________________
Date: Sun, 10 Feb 2008 20:54:52 -0800
From: hus...@ya...
To: dev...@li...
Subject: [Dev-C++] Time Delay
Hi,
I am using Dev C++. I want to know that how to use time delay function in Dev C++. I am doing my assignment please make it hurry.
Husnain Raza.
________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now.
_________________________________________________________________
Your Future Starts Here. Dream it? Then be it! Find it at www.seek.com.au
http://a.ninemsn.com.au/b.aspx?URL=https%3A%2F%2F2.zoppoz.workers.dev%3A443%2Fhttp%2Fninemsn%2Eseek%2Ecom%2Eau%2F%3Ftracking%3Dsk%3Ahet%3Ask%3Anine%3A0%3Ahot%3Atext&_t=764565661&_r=OCT07_endtext_Future&_m=EXT
|
|
From: Eric <eri...@wo...> - 2008-02-11 05:04:56
|
----- Original Message -----
Sent: Monday, February 11, 2008 6:06 PM
Subject: Re: [Dev-C++] Time Delay
What have you got so far?
CONVERTED TO PLAIN TEXT FORMAT TO SAVE INTERNET BANDWIDTH THAT IS GETTING
NICKED BY EVERYONE DOWNLOADING MOVIES.
& ALSO SAVE SPACE ON YOUR HARD DRIVE NOT TOO MENTION ............
----- Original Message -----
From: paki tiger
To: dev...@li...
Sent: Sunday, February 10, 2008 8:54 PM
Subject: [Dev-C++] Time Delay
Hi,
I am using Dev C++. I want to know that how to use time delay
function in Dev C++. I am doing my assignment please make it hurry.
Husnain Raza.
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it
now.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
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
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.516 / Virus Database: 269.20.0/1268 - Release Date: 2/9/08
11:54 AM
|
|
From: paki t. <hus...@ya...> - 2008-02-11 04:55:00
|
Hi,
I am using Dev C++. I want to know that how to use time delay function in Dev C++. I am doing my assignment please make it hurry.
Husnain Raza.
____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs |