dev-cpp-users Mailing List for Dev-C++ (Page 685)
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
You can subscribe to this list here.
| 2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(15) |
Oct
(115) |
Nov
(154) |
Dec
(258) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2001 |
Jan
(377) |
Feb
(260) |
Mar
(249) |
Apr
(188) |
May
(152) |
Jun
(150) |
Jul
(195) |
Aug
(202) |
Sep
(200) |
Oct
(286) |
Nov
(242) |
Dec
(165) |
| 2002 |
Jan
(245) |
Feb
(241) |
Mar
(239) |
Apr
(346) |
May
(406) |
Jun
(369) |
Jul
(418) |
Aug
(357) |
Sep
(362) |
Oct
(597) |
Nov
(455) |
Dec
(344) |
| 2003 |
Jan
(446) |
Feb
(397) |
Mar
(515) |
Apr
(524) |
May
(377) |
Jun
(387) |
Jul
(532) |
Aug
(364) |
Sep
(294) |
Oct
(352) |
Nov
(295) |
Dec
(327) |
| 2004 |
Jan
(416) |
Feb
(318) |
Mar
(324) |
Apr
(249) |
May
(259) |
Jun
(218) |
Jul
(212) |
Aug
(259) |
Sep
(158) |
Oct
(162) |
Nov
(214) |
Dec
(169) |
| 2005 |
Jan
(111) |
Feb
(165) |
Mar
(199) |
Apr
(147) |
May
(131) |
Jun
(163) |
Jul
(235) |
Aug
(136) |
Sep
(84) |
Oct
(88) |
Nov
(113) |
Dec
(100) |
| 2006 |
Jan
(85) |
Feb
(119) |
Mar
(33) |
Apr
(31) |
May
(56) |
Jun
(68) |
Jul
(18) |
Aug
(62) |
Sep
(33) |
Oct
(55) |
Nov
(19) |
Dec
(40) |
| 2007 |
Jan
(22) |
Feb
(49) |
Mar
(34) |
Apr
(51) |
May
(66) |
Jun
(43) |
Jul
(116) |
Aug
(57) |
Sep
(70) |
Oct
(69) |
Nov
(97) |
Dec
(86) |
| 2008 |
Jan
(32) |
Feb
(47) |
Mar
(106) |
Apr
(67) |
May
(28) |
Jun
(39) |
Jul
(31) |
Aug
(25) |
Sep
(18) |
Oct
(25) |
Nov
(5) |
Dec
(21) |
| 2009 |
Jan
(33) |
Feb
(27) |
Mar
(27) |
Apr
(22) |
May
(22) |
Jun
(10) |
Jul
(17) |
Aug
(9) |
Sep
(21) |
Oct
(13) |
Nov
(4) |
Dec
(11) |
| 2010 |
Jan
(10) |
Feb
(8) |
Mar
(4) |
Apr
(1) |
May
|
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(8) |
Oct
(26) |
Nov
(9) |
Dec
(1) |
| 2011 |
Jan
(21) |
Feb
(16) |
Mar
(4) |
Apr
(19) |
May
(26) |
Jun
(9) |
Jul
(6) |
Aug
|
Sep
(4) |
Oct
(3) |
Nov
(2) |
Dec
(1) |
| 2012 |
Jan
(4) |
Feb
(7) |
Mar
(4) |
Apr
|
May
(1) |
Jun
(10) |
Jul
(1) |
Aug
(1) |
Sep
(18) |
Oct
(3) |
Nov
(1) |
Dec
(1) |
| 2013 |
Jan
(4) |
Feb
(2) |
Mar
(15) |
Apr
(6) |
May
(1) |
Jun
(3) |
Jul
(1) |
Aug
(2) |
Sep
(4) |
Oct
|
Nov
(9) |
Dec
|
| 2014 |
Jan
(4) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(5) |
Aug
(4) |
Sep
|
Oct
(2) |
Nov
(1) |
Dec
(4) |
| 2015 |
Jan
(2) |
Feb
(3) |
Mar
(1) |
Apr
(2) |
May
(1) |
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(2) |
Oct
(9) |
Nov
(35) |
Dec
(6) |
| 2016 |
Jan
(7) |
Feb
(10) |
Mar
(10) |
Apr
(9) |
May
(13) |
Jun
(9) |
Jul
(1) |
Aug
(3) |
Sep
(3) |
Oct
(1) |
Nov
(1) |
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2018 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2019 |
Jan
(1) |
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2020 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Johannes P. <joh...@pr...> - 2001-07-16 13:15:50
|
Lo there ----------- I am Sorry but I dont follow your Question so lekka. Can you maybe give a bigger Code Example for us to wrok with. Or have I missed a thread here Sorry if I am misunderstanding your query Johannes At 09:35 14/07/2001 -0700, you wrote: >On Fri, 13 Jul 2001 12:01:43 -0700, dev...@li... >wrote: > > > Send Dev-cpp-users mailing list submissions to > > dev...@li... > > > > To subscribe or unsubscribe via the World Wide Web, visit > > http://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > or, via email, send a message with subject or body 'help' to > > dev...@li... > > > > You can reach the person managing the list at > > dev...@li... > > > > When replying, please edit your Subject line so it is more specific > > than "Re: Contents of Dev-cpp-users digest..." > > > > > > Today's Topics: > > > > 1. Need some help with compiling PureLS (TCHAR probs ect..) (Johannes >Pretorius) > > 2. RE: Basic C question: scanf (Mary Sipple) > > > > --__--__-- > > > > Message: 1 > > Date: Fri, 13 Jul 2001 09:35:58 +0200 > > To: dev...@li... > > From: Johannes Pretorius <joh...@pr...> > > Cc: dev...@li... > > Subject: [Dev-C++] Need some help with compiling PureLS (TCHAR probs >ect..) > > Reply-To: dev...@li... > > > > --=====================_9658778==_.ALT > > Content-Type: text/plain; charset="us-ascii"; format=flowed > > > > Hi All > > -0-0-0-0 > > > > I need some help here with getting PureLS from : http://www.purels.net/ > > > > To Compile with DevC++ The problem is that for starters it uses TCHAR > > varaibles as _TCHAR > > I geuss it is a Micro$oft thinf for I dont see it in the Header file of > > DevC++ So I added it ,, Saw No problem anymore > > But I need to know that this define that I added wont effect DevC++ in > > other projects somewhere else ?? I hope not > > and dont forsee it to, But I need to know. Also I have a problem that I > > cant get some help on _tfopen this is > > a problem as I struggle to get the next piece of coding to compile > > > > //-- SNIPPET START > > f = _tfopen(fPath, _T("r")); > > //--END SNIPPET > > > > I get the following Error > > > > warning: assignment makes pointer from integer without a cast > > > > This is funny And I cant seem to solve this for I cant give the function >'s > > Address for my understanding says that it already > > give a address back (the file pointer (stream pointer)). Thus I am >missing > > something So please help in this sense.. > > > > Well that is all for now > > > > Thanks for help > > > > Johannes > > > > > > > > --=====================_9658778==_.ALT > > Content-Type: text/html; charset="us-ascii" > > > > <html> > > Hi All<br> > > -0-0-0-0<br><br> > > I need some help here with getting PureLS from : > > <a href="http://www.purels.net/" >eudora="autourl">http://www.purels.net/</a><br><br> > > To Compile with DevC++ The problem is that for starters it uses TCHAR > > varaibles as _TCHAR<br> > > I geuss it is a Micro$oft thinf for I dont see it in the Header file of > > DevC++ So I added it ,, Saw No problem anymore<br> > > But I need to know that this define that I added wont effect DevC++ in > > other projects somewhere else ?? I hope not<br> > > and dont forsee it to, But I need to know. Also I have a problem that I > > cant get some help on _tfopen this is<br> > > a problem as I struggle to get the next piece of coding to > > compile<br><br> > > //-- SNIPPET START<br> > > <x-tab> </x-tab><b>f = > > _tfopen(fPath, _T("r"));<br> > > </b>//--END SNIPPET<br><br> > > I get the following Error<br><br> > > <font face="MS Sans Serif, Geneva" size=2><b>warning: assignment makes > > pointer from integer without a cast<br><br> > > </b></font>This is funny And I cant seem to solve this for I cant give > > the function 's Address for my understanding says that it already<br> > > give a address back (the file pointer (stream pointer)). Thus I am > > missing something So please help in this sense.. <br><br> > > Well that is all for now<br><br> > > Thanks for help<br><br> > > Johannes<br><br> > > <br> > > </html> > > > > --=====================_9658778==_.ALT-- > > > > > > > > --__--__-- > > > > Message: 2 > > From: "Mary Sipple" <ms...@in...> > > To: <dev...@li...> > > Subject: RE: [Dev-C++] Basic C question: scanf > > Date: Thu, 12 Jul 2001 22:43:17 -0700 > > Reply-To: dev...@li... > > > > Thanks to everyone who replied. I had expected the <cr> to be a legal >input. > > Thanks for the info. > > > > Mary > > > > -----Original Message----- > > From: dev...@li... > > [mailto:dev...@li...]On Behalf Of > > Nurhidayat > > Sent: Wednesday, July 11, 2001 11:03 PM > > To: dev...@li... > > Subject: Re: [Dev-C++] Basic C question: scanf > > > > > > At 20:47 11/07/2001 -0700, you wrote: > > >When the program is run, the prompt "Enter salaries:" is printed. After > > >that, I enter a series of numbers, then press the Enter key. The printf >in > > >the loop is executed for each number input, but then the program hangs. > > > > No, it doesn't hang. > > After the printf in the loop is executed, scanf still waiting legal >input. > > > > while (scanf("%lf", &salary) == 1) { > > ... > > } > > > > So to finish scanf, you have to give illegal input or non numeric > > character, like 'x' (or another alphabet character you like) then press > > [Enter]. > > > > Try to give input like this: > > > > Enter salaries: 100 200 150 600 x [Enter] > > > > > > > > If you write loop like this > > > > while (scanf("%lf", &salary) != EOF) { > > ... > > } > > > > You can use <ctrl>Z to finish input. > > > > > > > > ___Nurhidayat___ > > > > > > > > _______________________________________________ > > Dev-cpp-users mailing list > > Dev...@li... > > http://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > > > > > > > > --__--__-- > > > > _______________________________________________ > > Dev-cpp-users mailing list > > Dev...@li... > > http://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > > > > End of Dev-cpp-users Digest > > >hi all, i'm a beginnere so this should be a simple question. What is a parse >error? When I put: >cin>>a; >after the Add() function declaration, Dev-C++ gives me an error, here it is: > >18 func.cpp | parse error before `>' >Can someone help? Thanks! > > > > > >_______________________________________________________ >Send a cool gift with your E-Card >http://www.bluemountain.com/giftcenter/ > > > >_______________________________________________ >Dev-cpp-users mailing list >Dev...@li... >http://lists.sourceforge.net/lists/listinfo/dev-cpp-users |
|
From: Sebastien Z <se...@ex...> - 2001-07-14 16:36:09
|
On Fri, 13 Jul 2001 12:01:43 -0700, dev...@li... wrote: > Send Dev-cpp-users mailing list submissions to > dev...@li... > > To subscribe or unsubscribe via the World Wide Web, visit > http://lists.sourceforge.net/lists/listinfo/dev-cpp-users > or, via email, send a message with subject or body 'help' to > dev...@li... > > You can reach the person managing the list at > dev...@li... > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Dev-cpp-users digest..." > > > Today's Topics: > > 1. Need some help with compiling PureLS (TCHAR probs ect..) (Johannes Pretorius) > 2. RE: Basic C question: scanf (Mary Sipple) > > --__--__-- > > Message: 1 > Date: Fri, 13 Jul 2001 09:35:58 +0200 > To: dev...@li... > From: Johannes Pretorius <joh...@pr...> > Cc: dev...@li... > Subject: [Dev-C++] Need some help with compiling PureLS (TCHAR probs ect..) > Reply-To: dev...@li... > > --=====================_9658778==_.ALT > Content-Type: text/plain; charset="us-ascii"; format=flowed > > Hi All > -0-0-0-0 > > I need some help here with getting PureLS from : http://www.purels.net/ > > To Compile with DevC++ The problem is that for starters it uses TCHAR > varaibles as _TCHAR > I geuss it is a Micro$oft thinf for I dont see it in the Header file of > DevC++ So I added it ,, Saw No problem anymore > But I need to know that this define that I added wont effect DevC++ in > other projects somewhere else ?? I hope not > and dont forsee it to, But I need to know. Also I have a problem that I > cant get some help on _tfopen this is > a problem as I struggle to get the next piece of coding to compile > > //-- SNIPPET START > f = _tfopen(fPath, _T("r")); > //--END SNIPPET > > I get the following Error > > warning: assignment makes pointer from integer without a cast > > This is funny And I cant seem to solve this for I cant give the function 's > Address for my understanding says that it already > give a address back (the file pointer (stream pointer)). Thus I am missing > something So please help in this sense.. > > Well that is all for now > > Thanks for help > > Johannes > > > > --=====================_9658778==_.ALT > Content-Type: text/html; charset="us-ascii" > > <html> > Hi All<br> > -0-0-0-0<br><br> > I need some help here with getting PureLS from : > <a href="http://www.purels.net/" eudora="autourl">http://www.purels.net/</a><br><br> > To Compile with DevC++ The problem is that for starters it uses TCHAR > varaibles as _TCHAR<br> > I geuss it is a Micro$oft thinf for I dont see it in the Header file of > DevC++ So I added it ,, Saw No problem anymore<br> > But I need to know that this define that I added wont effect DevC++ in > other projects somewhere else ?? I hope not<br> > and dont forsee it to, But I need to know. Also I have a problem that I > cant get some help on _tfopen this is<br> > a problem as I struggle to get the next piece of coding to > compile<br><br> > //-- SNIPPET START<br> > <x-tab> </x-tab><b>f = > _tfopen(fPath, _T("r"));<br> > </b>//--END SNIPPET<br><br> > I get the following Error<br><br> > <font face="MS Sans Serif, Geneva" size=2><b>warning: assignment makes > pointer from integer without a cast<br><br> > </b></font>This is funny And I cant seem to solve this for I cant give > the function 's Address for my understanding says that it already<br> > give a address back (the file pointer (stream pointer)). Thus I am > missing something So please help in this sense.. <br><br> > Well that is all for now<br><br> > Thanks for help<br><br> > Johannes<br><br> > <br> > </html> > > --=====================_9658778==_.ALT-- > > > > --__--__-- > > Message: 2 > From: "Mary Sipple" <ms...@in...> > To: <dev...@li...> > Subject: RE: [Dev-C++] Basic C question: scanf > Date: Thu, 12 Jul 2001 22:43:17 -0700 > Reply-To: dev...@li... > > Thanks to everyone who replied. I had expected the <cr> to be a legal input. > Thanks for the info. > > Mary > > -----Original Message----- > From: dev...@li... > [mailto:dev...@li...]On Behalf Of > Nurhidayat > Sent: Wednesday, July 11, 2001 11:03 PM > To: dev...@li... > Subject: Re: [Dev-C++] Basic C question: scanf > > > At 20:47 11/07/2001 -0700, you wrote: > >When the program is run, the prompt "Enter salaries:" is printed. After > >that, I enter a series of numbers, then press the Enter key. The printf in > >the loop is executed for each number input, but then the program hangs. > > No, it doesn't hang. > After the printf in the loop is executed, scanf still waiting legal input. > > while (scanf("%lf", &salary) == 1) { > ... > } > > So to finish scanf, you have to give illegal input or non numeric > character, like 'x' (or another alphabet character you like) then press > [Enter]. > > Try to give input like this: > > Enter salaries: 100 200 150 600 x [Enter] > > > > If you write loop like this > > while (scanf("%lf", &salary) != EOF) { > ... > } > > You can use <ctrl>Z to finish input. > > > > ___Nurhidayat___ > > > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > http://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > > > --__--__-- > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > http://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > End of Dev-cpp-users Digest hi all, i'm a beginnere so this should be a simple question. What is a parse error? When I put: cin>>a; after the Add() function declaration, Dev-C++ gives me an error, here it is: 18 func.cpp | parse error before `>' Can someone help? Thanks! _______________________________________________________ Send a cool gift with your E-Card http://www.bluemountain.com/giftcenter/ |
|
From: Luigi S. <gi...@li...> - 2001-07-13 22:41:09
|
In my opinion you should use the solution suggested by Nurhidayat (I mean
compare the value returned by scanf with EOF, see below), in fact this
allows your code be used like a "filter".
Just in case you are not familiar with redirection and pipes, here is what
I mean.
Suppose you wish to input these values: 100 200 300
You could feed the values via console (as you usually do) or by the
following two steps: (I assume that you are in a DOS box, and your
executable is named salary.exe)
- write the values in a text file (say that you name the file: salary.dat)
- launch the command: salary < salary.dat.
try also: salary < salary.dat > out.dat
and : salary < salary.dat >> out.dat
The above is redirection.
Better yet: if the values to be fed to salary.exe are the output of another
executable (say it: compute.exe), assuming that it writes to stdout, you
could tie the output of "compute" to the input of "salary" by the following
command:
compute | salary
The above is an example of a "pipe".
Hope this was of some help.
At 22.43 12/07/01 -0700, you wrote:
>Thanks to everyone who replied. I had expected the <cr> to be a legal input.
>Thanks for the info.
>
>Mary
>
>
>
>If you write loop like this
>
> while (scanf("%lf", &salary) != EOF) {
> ...
> }
>
>You can use <ctrl>Z to finish input.
>
>
>
>___Nurhidayat___
>
>
>
>_______________________________________________
>Dev-cpp-users mailing list
>Dev...@li...
>http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
>
>_______________________________________________
>Dev-cpp-users mailing list
>Dev...@li...
>http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
---
gisan
|
|
From: Mary S. <ms...@in...> - 2001-07-13 15:28:04
|
Thanks to everyone who replied. I had expected the <cr> to be a legal input.
Thanks for the info.
Mary
-----Original Message-----
From: dev...@li...
[mailto:dev...@li...]On Behalf Of
Nurhidayat
Sent: Wednesday, July 11, 2001 11:03 PM
To: dev...@li...
Subject: Re: [Dev-C++] Basic C question: scanf
At 20:47 11/07/2001 -0700, you wrote:
>When the program is run, the prompt "Enter salaries:" is printed. After
>that, I enter a series of numbers, then press the Enter key. The printf in
>the loop is executed for each number input, but then the program hangs.
No, it doesn't hang.
After the printf in the loop is executed, scanf still waiting legal input.
while (scanf("%lf", &salary) == 1) {
...
}
So to finish scanf, you have to give illegal input or non numeric
character, like 'x' (or another alphabet character you like) then press
[Enter].
Try to give input like this:
Enter salaries: 100 200 150 600 x [Enter]
If you write loop like this
while (scanf("%lf", &salary) != EOF) {
...
}
You can use <ctrl>Z to finish input.
___Nurhidayat___
_______________________________________________
Dev-cpp-users mailing list
Dev...@li...
http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|
|
From: Johannes P. <joh...@pr...> - 2001-07-13 07:24:51
|
Hi All -0-0-0-0 I need some help here with getting PureLS from : http://www.purels.net/ To Compile with DevC++ The problem is that for starters it uses TCHAR varaibles as _TCHAR I geuss it is a Micro$oft thinf for I dont see it in the Header file of DevC++ So I added it ,, Saw No problem anymore But I need to know that this define that I added wont effect DevC++ in other projects somewhere else ?? I hope not and dont forsee it to, But I need to know. Also I have a problem that I cant get some help on _tfopen this is a problem as I struggle to get the next piece of coding to compile //-- SNIPPET START f = _tfopen(fPath, _T("r")); //--END SNIPPET I get the following Error warning: assignment makes pointer from integer without a cast This is funny And I cant seem to solve this for I cant give the function 's Address for my understanding says that it already give a address back (the file pointer (stream pointer)). Thus I am missing something So please help in this sense.. Well that is all for now Thanks for help Johannes |
|
From: Eric A. <eri...@ho...> - 2001-07-12 17:08:31
|
Or you coul do
//Add the following lines
#include <ctype.h>
#define Done 0;
#define True !done;
While(!done)
then somewhere in the loop ask if they was to continue
printf("Would you like to enter more values? Y/N/x20");
ch=toupper(gets(ch));
If(ch == 'Y') Done = True;
then end the loop.
>----- Original Message -----
>From: "Mary Sipple" <ms...@in...>
>To: <dev...@li...>
>Sent: Thursday, July 12, 2001 4:47 AM
>Subject: [Dev-C++] Basic C question: scanf
>
>
> > I've written a short program using Dev-C++ 4, but it does not execute as
>I
> > would expect. The code is as follows:
> >
> > #include <stdio.h>
> >
> > int main(int argc, char *argv[])
> > {
> > double salary, fed_withhold, state_withhold;
> > double salary_sum = 0, fed_sum = 0, state_sum = 0;
> >
> > printf("Enter salaries: ");
> > while (scanf("%lf", &salary) == 1){
> > fed_withhold = salary * .17;
> > state_withhold = salary * .03;
> > printf("salary: %.2f fed tax: %.2f state tax: %.2f\n",
> > salary, fed_withhold, state_withhold);
> > salary_sum += salary;
> > fed_sum += fed_withhold;
> > state_sum += state_withhold;
> > }
> > printf("\nSalary total: %.2f Fed tax total: %.2f State tax total:
>%.2f\n",
> > salary_sum, fed_sum, state_sum);
> >
> > system("PAUSE");
> > return 0;
> > }
> >
> > When the program is run, the prompt "Enter salaries:" is printed. After
> > that, I enter a series of numbers, then press the Enter key. The printf
>in
> > the loop is executed for each number input, but then the program hangs.
>I
> > have to either interrupt the program (<cntrl>-z worked for this) or type
>in
> > alpha characters and hit Enter. At that point the printf after the while
> > loop is executed.
> >
> > What have I got wrong or what is it that I don't understand?
> >
> > Thanks,
> >
> > Mary
> >
> >
> > _______________________________________________
> > Dev-cpp-users mailing list
> > Dev...@li...
> > http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
>
>_______________________________________________
>Dev-cpp-users mailing list
>Dev...@li...
>http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com
|
|
From: Vassili <v.v...@bt...> - 2001-07-12 11:35:22
|
The reason it hangs, or seems to hang, is because your in a loop. The
scanf() is waiting for an input. When you type in an alpha character, the
return value isn't 1, so you exit the loop. You might be better off using a
"yes" or "no" style system to exit the loop. In essence, something like:
char ch = 'Y'; // Initialise to enter loop
while( (ch == 'Y') || (ch == 'y') ) {
scanf();
// Rest of code
printf("Continue ?");
ch = getchar();
}
Best of luck
Vas
----- Original Message -----
From: "Mary Sipple" <ms...@in...>
To: <dev...@li...>
Sent: Thursday, July 12, 2001 4:47 AM
Subject: [Dev-C++] Basic C question: scanf
> I've written a short program using Dev-C++ 4, but it does not execute as I
> would expect. The code is as follows:
>
> #include <stdio.h>
>
> int main(int argc, char *argv[])
> {
> double salary, fed_withhold, state_withhold;
> double salary_sum = 0, fed_sum = 0, state_sum = 0;
>
> printf("Enter salaries: ");
> while (scanf("%lf", &salary) == 1){
> fed_withhold = salary * .17;
> state_withhold = salary * .03;
> printf("salary: %.2f fed tax: %.2f state tax: %.2f\n",
> salary, fed_withhold, state_withhold);
> salary_sum += salary;
> fed_sum += fed_withhold;
> state_sum += state_withhold;
> }
> printf("\nSalary total: %.2f Fed tax total: %.2f State tax total:
%.2f\n",
> salary_sum, fed_sum, state_sum);
>
> system("PAUSE");
> return 0;
> }
>
> When the program is run, the prompt "Enter salaries:" is printed. After
> that, I enter a series of numbers, then press the Enter key. The printf in
> the loop is executed for each number input, but then the program hangs. I
> have to either interrupt the program (<cntrl>-z worked for this) or type
in
> alpha characters and hit Enter. At that point the printf after the while
> loop is executed.
>
> What have I got wrong or what is it that I don't understand?
>
> Thanks,
>
> Mary
>
>
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|
|
From: Johannes P. <joh...@pr...> - 2001-07-12 08:30:05
|
Lo there ------------ Sorry but my mail does not always reach the mailing list. So I hope you forgive that I am sending to your private mailbox also.. I have found a good starting point at some site's And they are as I found in the following order helpFull.. NOTE one thing thou considering you want to write a 3D - game from scracth it would be nice that you know some assembler also for when coming to graphics time is very important for you only have such a small gap to the video memory to work with But here is the sites as follows : http://www.ddj.com/articles/2001/0165/0165f/0165f.htm Is a programming black book for graphics. Is also from the oak who helped optimize Quake for 3d realtime http://www.geocities.com/SiliconValley/2151/pcgpe.html Is a old but goos site for info on how to start and what whent wrong known as PC Game Programming Encyclopedia. Note look at the articles that was destiend for the second version. It can be helpfull Also http://www.qzx.com/pc-gpe/ And this is a online version of the above mentioned http://qzx.com/lib/ Is a good libary with good links to sites with more info .. Use the search it is helpfull Well good luck Johannes |
|
From: Nurhidayat <dh...@ma...> - 2001-07-12 06:06:12
|
At 20:47 11/07/2001 -0700, you wrote:
>When the program is run, the prompt "Enter salaries:" is printed. After
>that, I enter a series of numbers, then press the Enter key. The printf in
>the loop is executed for each number input, but then the program hangs.
No, it doesn't hang.
After the printf in the loop is executed, scanf still waiting legal input.
while (scanf("%lf", &salary) == 1) {
...
}
So to finish scanf, you have to give illegal input or non numeric
character, like 'x' (or another alphabet character you like) then press
[Enter].
Try to give input like this:
Enter salaries: 100 200 150 600 x [Enter]
If you write loop like this
while (scanf("%lf", &salary) != EOF) {
...
}
You can use <ctrl>Z to finish input.
___Nurhidayat___
|
|
From: Nurhidayat <dh...@ma...> - 2001-07-12 05:52:45
|
At 20:47 11/07/2001 -0700, you wrote:
>When the program is run, the prompt "Enter salaries:" is printed. After
>that, I enter a series of numbers, then press the Enter key. The printf in
>the loop is executed for each number input, but then the program hangs.
No, it doesn't hang.
After the printf in the loop is executed, scanf still waiting legal input.
while (scanf("%lf", &salary) == 1) {
...
}
So to finish scanf, you have to give illegal input or non numeric
character, like 'x' (or another alphabet character you like) then press
[Enter].
Try to give input like this:
Enter salaries: 100 200 150 600 x [Enter]
___Nurhidayat___
|
|
From: Mary S. <ms...@in...> - 2001-07-12 03:45:48
|
I've written a short program using Dev-C++ 4, but it does not execute as I
would expect. The code is as follows:
#include <stdio.h>
int main(int argc, char *argv[])
{
double salary, fed_withhold, state_withhold;
double salary_sum = 0, fed_sum = 0, state_sum = 0;
printf("Enter salaries: ");
while (scanf("%lf", &salary) == 1){
fed_withhold = salary * .17;
state_withhold = salary * .03;
printf("salary: %.2f fed tax: %.2f state tax: %.2f\n",
salary, fed_withhold, state_withhold);
salary_sum += salary;
fed_sum += fed_withhold;
state_sum += state_withhold;
}
printf("\nSalary total: %.2f Fed tax total: %.2f State tax total: %.2f\n",
salary_sum, fed_sum, state_sum);
system("PAUSE");
return 0;
}
When the program is run, the prompt "Enter salaries:" is printed. After
that, I enter a series of numbers, then press the Enter key. The printf in
the loop is executed for each number input, but then the program hangs. I
have to either interrupt the program (<cntrl>-z worked for this) or type in
alpha characters and hit Enter. At that point the printf after the while
loop is executed.
What have I got wrong or what is it that I don't understand?
Thanks,
Mary
|
|
From: <ste...@ge...> - 2001-07-11 22:37:39
|
-----Oprindelig meddelelse----- Fra: dev...@li... [mailto:dev...@li...]Pa vegne af Zeb Sendt: 11. juli 2001 23:07 Til: dev...@li... Emne: [Dev-C++] Re: Rays? Stein wrote: > I'm trying to make some simple 3D-game from the > bottom. Some what like Wolfenstein 3D, or so. I > really would like help on how to do this! > Also, I'm wondering; what is a raycaster, and a > raytracer? So, you want to make a 3d game from the bottom... meaning you don't want to use OpenGL or DirectX or suchlike? Yep... I would like to code the entire thing my self. Straight from the bottom :) What's the best way to do it, and how is good for games? > c(++) u later Cute ;) Z e L b u l v o n __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail http://personal.mail.yahoo.com/ _______________________________________________ Dev-cpp-users mailing list Dev...@li... http://lists.sourceforge.net/lists/listinfo/dev-cpp-users |
|
From: Zeb <Gai...@ro...> - 2001-07-11 21:07:18
|
Stein wrote: > I'm trying to make some simple 3D-game from the > bottom. Some what like Wolfenstein 3D, or so. I > really would like help on how to do this! > Also, I'm wondering; what is a raycaster, and a > raytracer? Oh, I can contribute here? I am just starting to learn C++, don't know much ;) I've read what a raytracer is, and could probly explain it to you, but it would be better for you to read what I've read, so go to povray.org. While you're there, you may want to download it, as povray is a free one. I think the difference between raycasters and raytracers may be the difference between starting at the light source, and starting at the camera, not sure. I believe povray uses both techniques, to get mirrors to reflect properly, or something. Somewhere on their site, they say that raytracers are not very good for games yet, as the raytracing process is horendously slow, and game graphics are generally rendered in real-time. So I suggest you temporarily forget the idea of raytracing for games, until computers do an even better job of blowing our minds away. So, you want to make a 3d game from the bottom... meaning you don't want to use OpenGL or DirectX or suchlike? > c(++) u later Cute ;) Z e L b u l v o n __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail http://personal.mail.yahoo.com/ |
|
From: <ste...@ge...> - 2001-07-11 18:11:32
|
Hi all! I'm trying to make some simple 3D-game from the bottom. Some what like Wolfenstein 3D, or so. I really would like help on how to do this! Also, I'm wondering; what is a raycaster, and a raytracer? Thanks! keep cooding c(++) u later - Stein - |
|
From: Jason O. <or...@am...> - 2001-07-11 04:17:11
|
Is there any way to get Dev-C++ to use an alternate compiler executable = name than gcc ? for example the compiler executable name for the GCC = tools for palmos is named m68k-palmos-gcc I've been able to use it by = renaming it to gcc.exe but this seems a little kludgy. Does anybody = have any thoughts? Jason Ormes or...@am... |
|
From: jansb000 <jan...@wx...> - 2001-07-10 21:24:13
|
http://boost.org/libs/dir_it/index.htm ----- Original Message -----=20 From: Elie Jamaa=20 To: dev...@li...=20 Sent: Sunday, July 08, 2001 2:26 PM Subject: [Dev-C++] cpp file management library Hiya - I'm looking for a multiplatform (actually Win32,linux,Irix) file = management library allowing me to do the following : Listing files with wildcards Finding file types (file, link or directory) Copying Moving and Deleting files and folders Dealing with paths I notices that there are a lot of file browsers out there. Do you guys = only use stdio ? Any help would be more than greatly appreciated :) Thanks in advance e. |
|
From: Elektro <el...@wo...> - 2001-07-10 17:29:02
|
Can I programming a driver (VXD) with DEV-C++ ? And a ActiveX DLL ? Where can I find an example ? Thanks |
|
From: Brian J. <lea...@ho...> - 2001-07-10 00:14:24
|
I am currently studying/learning windows programming from a book that is a few years old. I have hit a brick wall with "SetClassLong()". I am getting the error: "In function `LRESULT WindowProcedure(HWND__ *, unsigned int, unsigned int, long int)': \menu.cpp:134: passing `HBRUSH__ *' to argument 3 of `SetClassLongA(HWND__ *, int, long int)' lacks a cast I am baffled and need to know if 'SetClassLong()' or 'SetClassLongA()' or neither are correct for sending a message to change background color. _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com |
|
From: <jos...@ya...> - 2001-07-09 08:28:56
|
Hi, I don't know the correct answer but perhaps you may want to investigate the message WM_DRAWITEM. Cheers, Chemanuel --- Lorenzo <co...@in...> escribió: > this code create a button with a bitmap over: > > hwndButton = CreateWindow( > "BUTTON", > "OK", > WS_VISIBLE| WS_CHILD | BS_DEFPUSHBUTTON |BS_BITMAP, > 5, > 5, > 46, > 46, > hwnd, > NULL, > (HINSTANCE) GetWindowLong(hwnd, GWL_HINSTANCE), > NULL); > > hBitmap = LoadImage(0, "stud.bmp", IMAGE_BITMAP, 92, 44, > LR_DEFAULTCOLOR | LR_LOADFROMFILE); > > SendMessage(hwndButton,BM_SETIMAGE,(WPARAM)IMAGE_BITMAP,(LPARAM)hBitmap); > > now i have two problems: > 1. i want to move the position of the bitmap of few pixels. > 2. if i disabled the button with api "EnableWindow" the button > become > gray, how can i avoid this? > > i hope someone can help me. > ---------------------------------------------------------------------------- > --- > If debugging is the process of removing bugs, > then programming must be the process of putting them in. > ---------------------------------------------------------------------------- > --- > > > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > http://lists.sourceforge.net/lists/listinfo/dev-cpp-users _______________________________________________________________ Do You Yahoo!? Yahoo! Messenger: Comunicación instantánea gratis con tu gente - http://messenger.yahoo.es |
|
From: Colin L. <col...@wa...> - 2001-07-09 00:41:58
|
Hello ! I've just put online the new Dev-C++ Resource Site. This should be better than the one old page you used to see before. I hope to be able to put a lot of information, documentation and packages on it (it is currently still under construction) so this is why you can submit your own resource, and so participate to the evolution of this site. You can reach it at http://www.bloodshed.net/dev or http://www.haikuzone.org/dev/ ps : i'll be out of town for about 4 days Greetings ! Colin |
|
From: Brasier <br...@Pu...> - 2001-07-08 20:06:49
|
Hi, Can someone PLEASE tell me a website that is HTML (no downloads) that can give me a full a-z tutorial on OPEN GL for the DEV C++ compiler... i have tried nehe.gamedev.net but that is for visual C++ and i am far too new to translate :) Thanks for any info.... Steve.B |
|
From: Elie J. <el...@dn...> - 2001-07-08 12:28:03
|
Hiya - I'm looking for a multiplatform (actually Win32,linux,Irix) file = management library allowing me to do the following : Listing files with wildcards Finding file types (file, link or directory) Copying Moving and Deleting files and folders Dealing with paths I notices that there are a lot of file browsers out there. Do you guys = only use stdio ? Any help would be more than greatly appreciated :) Thanks in advance e. |
|
From: Ioannis V. <no...@ya...> - 2001-07-07 13:14:27
|
> -----Original Message-----
> From: dev...@li...
> [mailto:dev...@li...] On Behalf
> Of Phil Schulz
> Sent: Saturday, July 07, 2001 10:21 AM
> To: dev...@li...
> Subject: Re: [Dev-C++] STL, iterators and pointers?
>
> okay, that's pretty clear. I had been looking at examples
> that start with defining an empty container and then adding
> to it using pushback() or insert(), so it wasn't clear to
> me... I forgot that I probably have to define copy
> constructors for my classes. Haven't tested this yet, but
> this might be the problem...
When you use pushback() and vector is full, new objects within the
vector are created.
> nope, definitely defined as objects.
> My problem is when I try to assign &(*iter) to a pointer, I
> get compile errors
> "initialization to `Book *' from `const Book *' discards
> qualifiers" I'll make the new pointer a const, but that'll
> require another function to be declared a CONST and on and on
> , to a point of uselessness.
Code that works:
A)
#include <vector>
class A
{
};
int main()
{
vector<A> test(10);
A *p;
p=&test[0];
}
B)
#include <vector>
class A
{
};
int main()
{
vector<A> test(10);
vector<A>::iterator iter=test.begin();
A *p;
p=&(*iter);
}
Code that does not work (of course):
#include <vector>
class A
{
};
int main()
{
vector<A> test(10);
vector<A>::const_iterator iter=test.begin();
A *p;
p=&(*iter);
}
You probably were using const_iterator or doing something else wrong.
Ioannis
* Ioannis Vranos
* Programming pages: http://www.noicys.f2s.com
* Alternative URL: http://run.to/noicys
|
|
From: Phil S. <fy...@qw...> - 2001-07-07 08:19:44
|
I wrote: > > Some questions about the STL containers and iterators. > > > > When you insert an object into a multiset (or list, etc.) > > does it create a copy of the original Object, or does it > > connect to the original? > Ioannis Vranos wrote: > When you say "multiset" i consider that you mean standard library > container. When you create an object of a container type containing a > standard object type then the number specified of objects are created. > > E.g.. > > vector<string> l(10); creates an array (vector) of 10 string objects > with the name l; These 10 string objects are created with the creation > of the vector. > > so if we have string s="Test"; > > l[0]=s; > > s is COPIED in l[0]; okay, that's pretty clear. I had been looking at examples that start with defining an empty container and then adding to it using pushback() or insert(), so it wasn't clear to me... I forgot that I probably have to define copy constructors for my classes. Haven't tested this yet, but this might be the problem... > > > > and I'm not sure how to ask this next one: > > If you have an iterator for the above multiset, can you get a generic > > Object* out of it that points to the Object? I tried taking > > the addressof the dereferenced iterator ( &(*iter) ) but that > > didn't seem to work out quite right... > > > > iterators act like pointers but they are not pointers. the &(*iter) of > yours should work. Perhaps the container contained pointers and not > objects? nope, definitely defined as objects. My problem is when I try to assign &(*iter) to a pointer, I get compile errors "initialization to `Book *' from `const Book *' discards qualifiers" I'll make the new pointer a const, but that'll require another function to be declared a CONST and on and on , to a point of uselessness. > Ioannis > > * Ioannis Vranos > * Programming pages: http://www.noicys.f2s.com > * Alternative URL: http://run.to/noicys > Thanks for your input. Phil |
|
From: Lorenzo <co...@in...> - 2001-07-06 15:41:09
|
this code create a button with a bitmap over:
hwndButton = CreateWindow(
"BUTTON",
"OK",
WS_VISIBLE| WS_CHILD | BS_DEFPUSHBUTTON |BS_BITMAP,
5,
5,
46,
46,
hwnd,
NULL,
(HINSTANCE) GetWindowLong(hwnd, GWL_HINSTANCE),
NULL);
hBitmap = LoadImage(0, "stud.bmp", IMAGE_BITMAP, 92, 44,
LR_DEFAULTCOLOR | LR_LOADFROMFILE);
SendMessage(hwndButton,BM_SETIMAGE,(WPARAM)IMAGE_BITMAP,(LPARAM)hBitmap);
now i have two problems:
1. i want to move the position of the bitmap of few pixels.
2. if i disabled the button with api "EnableWindow" the button become
gray, how can i avoid this?
i hope someone can help me.
----------------------------------------------------------------------------
---
If debugging is the process of removing bugs,
then programming must be the process of putting them in.
----------------------------------------------------------------------------
---
|