dev-cpp-users Mailing List for Dev-C++ (Page 493)
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: Luc Saint-E. <lu...@re...> - 2002-11-05 12:25:04
|
Hello, I use Dev-Cpp 4.9.6.7 with wxWindiws Pack 2.29 and every thing is OK, I can compile successfully new projects. I'm trying to compile wxWindows sample "notebook" (from the 2..2.9 distribution) Compile fails and Dev-Cpp complains : [Resource Error] can't open cursor file `wx/msw/hand.cur': No such file or directory In my machine hand.cur is in : D:\Dev-Cpp\include\wx\msw In my Dev-Cpp in Menu : tools-> Compiler Options-> C++ Includes (and also C includes) I added the lines D:\Dev-Cpp\include\wx D:\Dev-Cpp\include\wx\msw So now there is : D:\Dev-Cpp\include\g++-3 D:\Dev-Cpp\include D:\Dev-Cpp\include\wx D:\Dev-Cpp\include\wx\msw Where did I screw up ? Thanks in advance Luc |
|
From: Teodorescu C. <te...@xt...> - 2002-11-05 07:44:31
|
Jerry van Dijk wrote:
>While trying out g++ 3.2, I did the following:
>
>-----------------------------------------------------------------
>#include <vector>
>#include <string>
>
>int main(int argc, char* argv[])
>{
> // std::vector<std::string> arguments(argv[0], argv[argc]);
> std::vector<std::string> arguments;
>
Your *arguments* vector has length 0 you must resize it to argc
or use
arguments.pushpack(argv[i]);
It's simple read :
http://www.oopweb.com/CPP/Documents/STLGuide/VolumeFrames.html
> for (int i=0; i<argc; i++)
> arguments[i]=argv[i];
>}
>-----------------------------------------------------------------
>
>which compiles Ok, but segfaults on execution. I did a lot of headscratching
>but I cannot figure out why. arguments[i] evaluates to a string type, argv[i]
>to effectively a const char*, and string has an const char* constructor.
>
>Help would be apreciated.
>
>
>
|
|
From: Michael I. <je...@am...> - 2002-11-05 00:37:20
|
This is in reference to Dev-C++ 5 Beta 6 Some of the compiler options for Dev-C++ don't seem to work. "Support all ANSI standard C programs" - doesn't add the -ansi switch to the commands "Attempt to support some aspects of traditional C preprocessors" - doesn't add the -traditional-cpp switch to the commands "Inhibit all warning messages" - doesn't add the -w switch to the commands. Is it a bug in this version of Dev-C++ Beta 6 or does it work for everyone else? (right now I simply add the switches in the "Add the following commands when calling compiler:" box |
|
From: Danny A. <tam...@ms...> - 2002-11-05 00:19:24
|
Hey guys;
this newbie is back at it again trying to figure out what I'm doing below=
is a very long piece of code in 5 different files that I'm trying to com=
pile in one project but for some reason even though I have typed it out o=
f a book and I have played with it and I have even gone to the authors so=
urce code and copied and paste from them and it still doesn't want to wor=
k. I'm beginning to believe it could be a difference in compilers the au=
thors used "CodeWarrior" and the book I'm using is "C++ Programming for t=
he absolute beginner". if anyone can be of help I would appreciate it bec=
ause it would truly teach me something I can't figure out.
Thanks in advance
Danny
//8.4 - Dragon Lord - Mark Lee - Prima Publishing
// Dragon.cpp
#include <string>
#include <ctime>
#include <cstdlib>
#define MAX(a,b) a>b? a:b
using namespace std;
class Dragon
{
private:
int speed;
string name;
int hitPoints;
int armour;
int treasure;
int clawDamage;
int size;
protected:
Dragon(int theSize);
int getArmour() {return armour;}
int& getHitPoints() {return hitPoints;}
int getClawDamage() { return clawDamage;}
int getSize() { return size;}
virtual int attack(int targetArmour, int specialDamage);
public:
virtual int attack(int targetArmour) =3D 0;
virtual void defend(int damage) =3D 0;
int getTreasure() {return treasure;}
virtual string getName() {return name;}
int getSpeed() {return speed;}
bool isAlive() { return hitPoints >0;}
};
Dragon::Dragon(int theSize) : =20
size(theSize)
{
if (size < 1 || size > 4)
size =3D 3;
clawDamage =3D 2 * size;
speed =3D 3 * size;
hitPoints =3D 4 * size;
armour =3D size;
treasure =3D 1000 * size;
srand(time(0));
}
int Dragon::attack(int targetArmour, int specialDamage)
{
int useSpecial =3D rand() % 2; // 0 or 1
int damage;
if (useSpecial) =20
damage =3D specialDamage;
else damage =3D getClawDamage();
return MAX(damage - targetArmour,0);
}
//BlackDragon.cpp
#include "Dragon.cpp"
class BlackDragon : public Dragon
{
private:
int poisonDamage;
public:
BlackDragon(int theSize);
int attack(int targetArmour);
void defend(int damage);
string getName() {return "Black Dragon";}
};
BlackDragon::BlackDragon(int theSize) :
Dragon(theSize)
{
poisonDamage =3D getSize();
}
int BlackDragon::attack(int targetArmour)
{
return Dragon::attack(targetArmour, poisonDamage);
}
void BlackDragon::defend(int damage)
{
getHitPoints() -=3D damage - getArmour();
}
//BlueDragon.cpp
#include "Dragon.cpp"
class BlueDragon : public Dragon
{
private:
int iceDamage;
public:
BlueDragon(int theSize);
int attack(int targetArmour);
void defend(int damage);
string getName() {return "Blue Dragon";}
};
BlueDragon::BlueDragon(int theSize) :
Dragon(theSize)
{
iceDamage =3D 3 * getSize();
}
int BlueDragon::attack(int targetArmour)
{
return Dragon::attack(targetArmour, iceDamage);
}
void BlueDragon::defend(int damage)
{
getHitPoints() -=3D (damage - getArmour())/2;
}
//RedDragon.cpp
#include "Dragon.cpp"
class RedDragon : public Dragon
{
private:
int fireDamage;
public:
RedDragon(int theSize);
int attack(int targetArmour);
void defend(int damage);
string getName() {return "Red Dragon";}
};
RedDragon::RedDragon(int theSize) :
Dragon(theSize)
{
fireDamage =3D 4 * getSize();
}
int RedDragon::attack(int targetArmour)
{
return Dragon::attack(targetArmour, fireDamage);
}
void RedDragon::defend(int damage)
{
getHitPoints() -=3D (damage - getArmour())/3;
}
//DragonLord.cpp
#include <iostream>
#include <ctime>
#include <cstdlib>
#include "Dragon.cpp"
#include "RedDragon.cpp"
#include "BlueDragon.cpp"
#include "BlackDragon.cpp"
using namespace std;
int menuChoice();
int main (void)
{
srand(time(0));
Dragon* dragons[3];
int hp =3D 15;
int armour =3D 2;
int tempArmour;
int tempAttack;
dragons[0] =3D new RedDragon(rand()%4+1);
dragons[1] =3D new BlackDragon(rand()%4+1);
dragons[2] =3D new BlueDragon(rand()%4+1);
Dragon* d =3D dragons[rand()%3];
cout << "Welcome noble knight.\n"
<< "You must save a princess."
<< " She has been captured by a "
<< d->getName() << ".\n"
<< "You must defeat the dragon.\n";
cout << "Your hit points are: " << hp << endl;
while (d->isAlive() && hp>0)
{
int choice =3D menuChoice();
if (choice =3D=3D 3) goto RUN;
else if (choice =3D=3D 1)
{
tempAttack =3D rand()%16+5;
tempArmour =3D armour;
}
else {
tempAttack =3D rand()%11;
tempArmour =3D armour + 4;
}
hp -=3D d->attack(armour);
d->defend(rand()%16-5);
cout << "\nYou deliver a mighty blow and deal "
<< tempAttack << " damage.\n";
cout << "Your hit points are: " << hp;
}
if (d->isAlive())
cout << "\nYou have perished before"
<< " the might of the dragon.\n";
else
cout << "\n\nYou have slain the dragon!"
<< " Congratulations.\n"
<< "The princess is saved.\n";
return 0;
RUN: =20
cout <<"\nYou have fled in cowardice.\n";
return 0;
}
int menuChoice()
{
int choice;
do {
cout << endl
<< "[1]Attack\n"
<< "[2]Defensive Mode\n"
<< "[3]Run Away\n";
cin >> choice;
} while (choice < 1 && choice > 3);
return choice;
} =20
|
|
From: Jerry v. D. <jv...@at...> - 2002-11-04 22:56:04
|
While trying out g++ 3.2, I did the following:
-----------------------------------------------------------------
#include <vector>
#include <string>
int main(int argc, char* argv[])
{
// std::vector<std::string> arguments(argv[0], argv[argc]);
std::vector<std::string> arguments;
for (int i=0; i<argc; i++)
arguments[i]=argv[i];
}
-----------------------------------------------------------------
which compiles Ok, but segfaults on execution. I did a lot of headscratching
but I cannot figure out why. arguments[i] evaluates to a string type, argv[i]
to effectively a const char*, and string has an const char* constructor.
Help would be apreciated.
--
-- Jerry van Dijk | email: jv...@at...
-- Leiden, Holland | web: users.ncrvnet.nl/gmvdijk
|
|
From: Carlos d. M. <cg...@wo...> - 2002-11-04 11:57:29
|
When I right-click on a function in the classes window, if I click then on the popup dialog to function implementation it does nothing. |
|
From: Thnourémi P. <ala...@if...> - 2002-11-04 10:51:27
|
First of all, I have to say that devcpp rules!!!! I'm trying to compile a multifile projet... using opengl and= glut. Devcpp compiles every file (I find *.o files) and the linker= jkeeps telling that He can't link opengl and glut cuz... the linkin= g does not effect!!! Why it does not effect? When I compile a one source file no problem... But when I try to compile a multifile project it's always th= e same problem... IT WON'T LINK! What have I missed? Thanks for answering PS: Iuse devccp 4.01 and wish V.5 will release soon... ____________________________________________________________= _______ Haut D=E9bit: Modem offert soit 150,92 euros rembours=E9s su= r le Pack eXtense de Wanadoo ! Profitez du Haut D=E9bit =E0 partir de 30 euros/mois : http:= //www.ifrance.com/_reloc/w |
|
From: Alexandr V. B. <ab...@cs...> - 2002-11-04 08:30:19
|
Thanks a lot! My problem was in Projects Options: I had to add -lfltk_gl -lopengl32 and -lglut32 in order to use OpenGl in Fltk. Alexandr On Sun, 3 Nov 2002, Andrew Dunets wrote: > > Hi. > > |Did anybody use Fl_Gl_Window? Send an simple example please. I get a lot > |of linker error when I try to use it. > > > It is OpenGL demo from original FLTK sources. > > With best regards, > Andrew Dunets. > > > > > > > > |
|
From: Eric R. <e.r...@pa...> - 2002-11-03 21:04:19
|
"Sorry Brain. You failed in the interview."
I not sure what above line means, the code below works OK, I think maybe
Brain passed.
#include <iostream.h>
#include <math.h>
int main()
{
double Number;
double Result;
cout << "Enter a number ";
cin >> Number;
Result = sqrt(Number);
if (Result == floor(Result))
{
cout << Number << " is a perfect square!" << endl;
}
if (Result != floor(Result))
{
cout << Number << " is not a perfect square!" << endl;
}
cin >> Number ;
return 1;
}
From Eric
NO ATTACHMENT WAS SENT WITH THIS EMAIL,
IF THERE IS ONE, IT IS A UNDETECTED VIRUS, PLEASE LET ME KNOW..
Black text on white background HTML Emails and replied with white text on
white.
-----Original Message-----
From: dev...@li...
[mailto:dev...@li...]On Behalf Of Ihsan Ali
Al Darhi
Sent: 26 October 2002 16:30
To: Brian C. Becker; dev...@li...
Subject: Re: [Dev-C++] Whole numbers and perfect square
> double Number;
> double Result;
> Result = sqrt(Number);
> if (Result == floor(Result)){
Sorry Brain. You failed in the interview.
Mohammed
-------------------------------------------------------
This SF.net email is sponsored by: ApacheCon, November 18-21 in
Las Vegas (supported by COMDEX), the only Apache event to be
fully supported by the ASF. http://www.apachecon.com
_______________________________________________
Dev-cpp-users mailing list
Dev...@li...
TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.410 / Virus Database: 231 - Release Date: 31/10/02
|
|
From: Ihsan A. Al D. <ia...@jo...> - 2002-11-03 19:46:20
|
> double Number;
> double Result;
> Result = sqrt(Number);
> if (Result == floor(Result)){
Sorry Brain. You failed in the interview.
Mohammed
|
|
From: Brian C. B. <bri...@ho...> - 2002-11-03 19:21:02
|
Hi Rafael,
> Is there a way to make the computer know when a number is a whole number
or
> a perfect square?
Yes, there is a method that I have used before (in calculating Pythagorean
theorem). Use the C library function sqrt to take the square root. Then to
see if the number is a perfect square (or a whole number), use the C library
function floor to round the number down to the nearest whole number. If the
two numbers are equal (the square root and the rounded square root), you
know that the number is a perfect square.
For example:
double Number;
double Result;
Result = sqrt(Number);
if (Result == floor(Result)){
cout << Number << " is a perfect square!" << endl;
}
Say, Number = 5, then
Result = 2.2
floor(Result) = 2
Not Perfect Square
Say, Number = 4, then
Result = 2
floor(Result) = 2
Is Prefect Square
I'm sure that there is a better and more efficient way, but that is a
method that has worked for me. Does that help?
Sincerely,
Brian C. Becker
Shall we accept good from God, and not trouble?
|
|
From: Rafael F. <rus...@ho...> - 2002-11-03 16:56:53
|
Hello, Is there a way to make the computer know when a number is a whole number or a perfect square? _________________________________________________________________ Surf the Web without missing calls! Get MSN Broadband. http://resourcecenter.msn.com/access/plans/freeactivation.asp |
|
From: shem <sh...@au...> - 2002-11-03 10:01:52
|
anybody knows, or has an example of how to create custom streams using the gnu c library? |
|
From: Alexandr V. B. <ab...@cs...> - 2002-11-03 08:28:50
|
Hi! Did anybody use Fl_Gl_Window? Send an simple example please. I get a lot of linker error when I try to use it. Thanks, Alexandr |
|
From: webmaster <web...@ob...> - 2002-11-03 04:23:16
|
SXMgdGhlcmUgYSB3YXkgdG8gcHJvZ3JhbSB0aGUgY29tcHV0ZXIgdG8ga25vdyB3aGVuIGEgbnVtYmVyIGlzIGEgDQpwZXJmZWN0IHNxdWFyZSwgYW5kIGEgd2F5IHRvIHJlY29nbml6ZSB3aGVuIGl0J3MgYSB3aG9sZSBudW1iZXI/IAo= |
|
From: Santiago <sa...@ho...> - 2002-11-02 21:26:13
|
Does anyone has the book call "C++ in Action" by Bartosz Milewski? If so, Can anyone spare a copy of the CD that comes with it. I accidently damaged mine. Thank you! San |
|
From: Ioannis V. <no...@ho...> - 2002-11-02 20:28:23
|
> -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of Per Westermark > Sent: Saturday, November 02, 2002 12:27 PM > To: Abhijit Shylanath > Cc: 'Dev-C++ Mailing List' > Subject: Re: [Dev-C++] Use of const qualifier > > > 1 - Declaring a function inline doesn't work for function pointers, > or when writing mixed-language programss. Usually yes. There is no rule however. For this reason, in C++ it is better to pass a type argument with static member functions. Or use function objects. > 2 - Eliminating the function to remove the function call > obviously doesn't > work either for same reason as above. > > 3 - The link referenced below is written with DSP processors > in mind. Some > optimization work. A lot of the suggestions are questionable on a > general-purpose processor. I am very busy these last days so i have no much time to post messages on the list. Regarding efficiency & C++, the best thing one can do is to use the high level constructs and do not bother about low level details. So for example use strings and pass them by reference and do not bother for the details. Regarding C, the compiler can perform whatever optimisations it likes. As a general rule one must try to avoid repeative function calls (like calling the same function 1 million times). Regarding variables with exception of large struct types, the time cost of creating and destroying variables in nowadays machine can be ignored. For a large struct, using a static struct variable can help. Again, one must think of run time optimisations when he sees that his code is unacceptable slow. Like for(size_t i=0; i<strlen(s); i++) /* ... */ If the compiler is clever, it may avoid calling strlen(), strlen(s) times. If we see that the code crawls (and only then), one can think of optimisations like: const size_t SLENGTH=strlen(s); for(size_t i=0; i<SLENGTH; i++) /* ... */ In general, do not think of optimising something without having a problem with it. Also usually run-time optimisation adds space cost, and space optimisation adds runtime cost. Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.freeurl.com * Alternative URL: http://run.to/noicys |
|
From: Carlos d. M. <cg...@wo...> - 2002-11-02 17:31:24
|
And for those cases you can use redirection, which means the output to st=
din
is sent to a file you specify, this is for console files. I proved it wit=
h
gprof, which is a part of the compiler's distribution, I haven't ever do =
it
whit my programs, but being this what it is said to be, it shall work.
For that you open the command.exe, or cmd.exe, and type
program yakyakyak > fileyouwantoutput
Abhijit Shylanath escribi=F3:
> > Maybe they're just asking how to handle files in C/C++... If
> > this is the case I sugest you to look for it in any book. Most of the=
m
> > has a part dedicated to this subject.
>
> Zodiaq was being sarcastic... he tends to do that sometimes :).
>
> Anyway, J B, look up file I/O in any book. In C++, we use the ifstream =
and
> ofstream classes to manage this. A small example:
>
> #include <fstream>
>
> int main()
> {
> using std::ofstream;
>
> ofstream of;
>
> of.open("temp.txt");
> if(!of)
> {
> // Error
> }
>
> of << "Blah, blah.\n";
> of.close();
>
> return 0;
> }
>
> ___________________________________________________________
>
> Abhijit Shylanath
>
> E-mail: mu...@gm... || ibr...@bi...
> Web-site: http://mudeth.tripod.com/
>
> -------------------------------------------------------
> This sf.net email is sponsored by: See the NEW Palm
> Tungsten T handheld. Power & Color in a compact size!
> http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|
|
From: Abhijit S. <mu...@gm...> - 2002-11-02 15:27:30
|
> Maybe they're just asking how to handle files in C/C++... If
> this is the case I sugest you to look for it in any book. Most of them
> has a part dedicated to this subject.
Zodiaq was being sarcastic... he tends to do that sometimes :).
Anyway, J B, look up file I/O in any book. In C++, we use the ifstream and
ofstream classes to manage this. A small example:
#include <fstream>
int main()
{
using std::ofstream;
ofstream of;
of.open("temp.txt");
if(!of)
{
// Error
}
of << "Blah, blah.\n";
of.close();
return 0;
}
___________________________________________________________
Abhijit Shylanath
E-mail: mu...@gm... || ibr...@bi...
Web-site: http://mudeth.tripod.com/
|
|
From: Abhijit S. <mu...@gm...> - 2002-11-02 15:27:23
|
> 1 - Declaring a function inline doesn't work for function pointers, > or when writing mixed-language programss. > > 2 - Eliminating the function to remove the function call obviously doesn't > work either for same reason as above. > > 3 - The link referenced below is written with DSP processors in mind. Some > optimization work. A lot of the suggestions are questionable on a > general-purpose processor. Most of the stuff is about C in general, so it should work on any C compiler. At least the point about inlining is with regard to C, so I thought I'd link to my source. ___________________________________________________________ Abhijit Shylanath E-mail: mu...@gm... || ibr...@bi... Web-site: http://mudeth.tripod.com/ |
|
From: <jp...@bo...> - 2002-11-02 14:53:19
|
Maybe they're just asking how to handle files in C/C++... If this is the case I sugest you to look for it in any book. Most of them has a part dedicated to this subject. ---------------------------------------------- Juliano P=E1vel Brasil Cust=F3dio http://www.jpavel.rg3.net --------------------------------------------- -----Original Message----- From: dev...@li... [mailto:dev...@li...] On Behalf Of Zodiaq Sent: s=E1bado, 2 de novembro de 2002 10:36 To: Dev...@li... Subject: Re: [Dev-C++] newbie question Hello j and all Dev-C++ users, Saturday, November 2, 2002, 12:14:31 PM, j wrote as follows: jb> hi all:) jb> i'm new to this group and i'd like to ask you all a question : me=20 jb> and my friend are working on a project,we'd like to have the results jb> in another file but none of us knows how to do that... anyone who=20 jb> can help?? First: don't use html when sending here question or answers... Second: another file you say?? This is totally not possible! Or very very hard - you would have to write special low level driver in ASM, then intall it into your OS to finally write biiiig GUI ( ind Visual Basic) for it - then you'd have debug it for more than a year... you waould have to add some useless feature - and after all this wark you'll get it... a new OS able to write files... yeeeeeeeeha! --=20 regards, Zodiaq ------------------------------------------------------- This sf.net email is sponsored by: See the NEW Palm=20 Tungsten T handheld. Power & Color in a compact size! http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en _______________________________________________ Dev-cpp-users mailing list Dev...@li... TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm https://lists.sourceforge.net/lists/listinfo/dev-cpp-users |
|
From: Zodiaq <zo...@ac...> - 2002-11-02 13:35:29
|
Hello j and all Dev-C++ users, Saturday, November 2, 2002, 12:14:31 PM, j wrote as follows: jb> hi all:) jb> i'm new to this group and i'd like to ask you all a question : me and my friend are working on a project,we'd like to have the results in another file but none of us knows how to do that... jb> anyone who can help?? First: don't use html when sending here question or answers... Second: another file you say?? This is totally not possible! Or very very hard - you would have to write special low level driver in ASM, then intall it into your OS to finally write biiiig GUI ( ind Visual Basic) for it - then you'd have debug it for more than a year... you waould have to add some useless feature - and after all this wark you'll get it... a new OS able to write files... yeeeeeeeeha! -- regards, Zodiaq |
|
From: <com...@ya...> - 2002-11-02 11:14:31
|
hi all:) i'm new to this group and i'd like to ask you all a question : me and my friend are working on a project,we'd like to have the results in another file but none of us knows how to do that... anyone who can help?? --------------------------------- Gesendet von http://mail.yahoo.de. Möchten Sie mit einem Gruß antworten? http://grusskarten.yahoo.de. |
|
From: Per W. <pw...@ia...> - 2002-11-02 10:27:36
|
1 - Declaring a function inline doesn't work for function pointers, or when writing mixed-language programss. 2 - Eliminating the function to remove the function call obviously doesn't work either for same reason as above. 3 - The link referenced below is written with DSP processors in mind. Some optimization work. A lot of the suggestions are questionable on a general-purpose processor. /Per W On Sat, 2 Nov 2002, Abhijit Shylanath wrote: > > > > > Yes. Also if you can make it easy to be inlined things will be more > > > better. > > > > Inlining a function is decided by the compiler. Functions with loops, etc. > > are generally not inlined, so this won't be of much help. You can achieve > > the same end by simply eliminating the function (moving all of the code > into > > the main routine). This will remove the overhead of function calls and > > memory allocation (which should help a lot in this case). This should be a > > case of code-elegance versus execution-speed. Also consider generating > > look-up tables of sine and cos. There are a lot of articles on the web > about > > optimizing programs. I remember one that spoke in explicit detail about > how > > memory can be optimized... unfortunately, I don't remember saving it. > Google > > helps. > > This site: > > http://www.numerix-dsp.com/c_coding.html > > says that static variables help. > > ___________________________________________________________ > > Abhijit Shylanath > > E-mail: mu...@gm... || ibr...@bi... > Web-site: http://mudeth.tripod.com/ > > > > > ------------------------------------------------------- > This sf.net email is sponsored by: See the NEW Palm > Tungsten T handheld. Power & Color in a compact size! > http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: Abhijit S. <mu...@gm...> - 2002-11-02 05:14:23
|
> > Yes. Also if you can make it easy to be inlined things will be more > > better. > > Inlining a function is decided by the compiler. Functions with loops, etc. > are generally not inlined, so this won't be of much help. You can achieve > the same end by simply eliminating the function (moving all of the code into > the main routine). This will remove the overhead of function calls and > memory allocation (which should help a lot in this case). This should be a > case of code-elegance versus execution-speed. Also consider generating > look-up tables of sine and cos. There are a lot of articles on the web about > optimizing programs. I remember one that spoke in explicit detail about how > memory can be optimized... unfortunately, I don't remember saving it. Google > helps. This site: http://www.numerix-dsp.com/c_coding.html says that static variables help. ___________________________________________________________ Abhijit Shylanath E-mail: mu...@gm... || ibr...@bi... Web-site: http://mudeth.tripod.com/ |