dev-cpp-users Mailing List for Dev-C++ (Page 251)
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: Jay B. <jay...@ni...> - 2004-02-16 16:18:33
|
[snip] Hi, my name is Lorenzo and I'm new in C++ programming. I'm writing a command line application using DEV-C++ and I want to pass to command line a sentence of type " myapp *.* " to make it work on all files in a directory. How can I do it? How can I pass a directory name to my application and make it work on current directory and all subdirectory? =20 [/snip] =20 =20 How about the readdir() function?=20 =20 P.S. Google is your friend.=20 |
|
From: <ca...@fb...> - 2004-02-16 15:44:12
|
hallo dev-cpp-users,
lp> Hi, my name is Lorenzo and I'm new in C++ programming. I'm writing a command line application using DEV-C++ and I want to pass to command line a sentence of type " myapp *.* " to make it work on
lp> all files in a directory. How can I do it? How can I pass a directory name to my application and make it work on current directory and all subdirectory?
isn't wildcarding a shell business?
as I recall, the wildcard is parsed by the shell which then sends a
list of all files to your app... when I recall correctly..
best regards
Christian
---
-o) _
caefer /\\ Message void if penguin violated V
c.2003 _\_V Don't mess with the penguin O
---------------------------------------------------
Christian
Isarstrasse 4 + Tel. : +49 (0)421 16 535 16
28199 Bremen + eMail: mailto:ca...@fb...
---------------------------------------------------
- graphics - webdevelopment - general programming -
|
|
From: <lor...@ya...> - 2004-02-16 13:21:28
|
Hi, my name is Lorenzo and I'm new in C++ programming. I'm writing a command line application using DEV-C++ and I want to pass to command line a sentence of type " myapp *.* " to make it work on all files in a directory. How can I do it? How can I pass a directory name to my application and make it work on current directory and all subdirectory? Thanks in advance, Lorenzo. --------------------------------- Yahoo! Mail: 6MB di spazio gratuito, 30MB per i tuoi allegati, l'antivirus, il filtro Anti-spam |
|
From: Emiliano <sky...@fa...> - 2004-02-16 09:12:38
|
----- Original Message ----- From: "Jens Tusche" <Tu...@gm...> To: <dev...@li...> Sent: Monday, February 16, 2004 8:59 AM Subject: [Dev-C++] Re: Dev-cpp-users digest, Vol 1 #1887 - 11 msgs > < Subject: [Dev-C++] Debugger not working? 4.9.8.7 > < > <As in the subject, it won't work at all on my winxp system. The project > gets > <compiled, the debugging window is there, but no "step" button does what it > <should, the step-by step execution doesn't start. In the output of gdb I've > <noticed this: > < > <frames-invalid > < > <What is the last version with debugger know to work? > > This sounds like the problem that I had. It seems that the debugger must be > manually coerced to generate the necessary debug information. Somebody told > me to put a "-g3" as a parameter to the compiler options. After I'd done this > everything has been working fine. First of all, thank you very much for your answer. I was loosing hope on this mailing list :) I've noticed that option was already present in the compiler prompt. I've also tried to add it as you suggested, but I still get the same problem. this is the complete gdb output: (gdb) prompt post-prompt breakpoints-invalid Breakpoint 2 at 0x40169c: file main.cpp, line 202. pre-prompt (gdb) prompt post-prompt Starting: "path/name.exe" Snooping with FileMonitor, I've noticed that there's an executable starting somewhere, but then nothing happens (no steps, no window opening, and so on...). The only effect is that debug window gets ghosted when I click twice on "Next Step" or "Debug" itself. Everything else simply does nothing. Also, if I open the cpu window, it goes in "wait timeout for debug command" error. As if the debugger is not there anymore... What can I do? :) regards Emiliano Esposito |
|
From: Jens T. <Tu...@gm...> - 2004-02-16 08:02:47
|
< Subject: [Dev-C++] Debugger not working? 4.9.8.7 < <As in the subject, it won't work at all on my winxp system. The project gets <compiled, the debugging window is there, but no "step" button does what it <should, the step-by step execution doesn't start. In the output of gdb I've <noticed this: < <frames-invalid < <What is the last version with debugger know to work? This sounds like the problem that I had. It seems that the debugger must be manually coerced to generate the necessary debug information. Somebody told me to put a "-g3" as a parameter to the compiler options. After I'd done this everything has been working fine. -- GMX ProMail (250 MB Mailbox, 50 FreeSMS, Virenschutz, 2,99 EUR/Monat...) jetzt 3 Monate GRATIS + 3x DER SPIEGEL +++ http://www.gmx.net/derspiegel +++ |
|
From: Lloyd A. <ll...@ea...> - 2004-02-16 03:18:59
|
In Console mode how about something like this.
This sends characters to my printer que (in XP), but I can't get it to
the printer.
#include <fstream.h>
int main()
{
char* s1 = "\nToday's winning number is ";
int n1 = 17982;
ofstream outfile;
outfile.open("PRN");
outfile << s1 << n1 << endl;
outfile << '\x0D';
return 0;
}
Lloyd
-----Original Message-----
From: dev...@li...
[mailto:dev...@li...] On Behalf Of Lloyd
Ashmore
Sent: Saturday, February 14, 2004 4:50 PM
To: dev...@li...
Subject: [Dev-C++] Printer output
Can someone show me how to get simple output to the printer.
I am also interested in being able to send a file to the printer.
Thanks in advance
Lloyd
|
|
From: Per W. <pw...@ia...> - 2004-02-15 23:06:01
|
For a system-independant solution you might look at the wxWindows framework. It contains some nice HTML classes that supports presentation of HTML pages. /Per W On Sun, 15 Feb 2004, Goran Rakic wrote: > Dana nedelja 15. februar 2004. 20:25, Per Westermark je napisao/la: > > Rich Text is one text format. > > HTML is another format. > > Ok, tell me for HTML. There is no need for full HTML 4 support, i need only > tables and text formating. > > Thanx, > Goran > > |
|
From: Goran R. <go...@de...> - 2004-02-15 19:47:19
|
Dana nedelja 15. februar 2004. 20:25, Per Westermark je napisao/la: > Rich Text is one text format. > HTML is another format. Ok, tell me for HTML. There is no need for full HTML 4 support, i need only tables and text formating. Thanx, Goran |
|
From: Per W. <pw...@ia...> - 2004-02-15 19:29:16
|
Rich Text is one text format. HTML is another format. Which of the two formats are you thinking about? /Per W On Sun, 15 Feb 2004, Goran Rakic wrote: > Dana nedelja 15. februar 2004. 09:31, Daniel Glenfield je napisao/la: > > in windows you do the following: > > 1) Get a handle to a printer device context > > 2) Call StartDoc() > > 3) Call StartPage() > > 4) Call GDI functions such as ellipse() and DrawText() > > 5) Call EndPage() > > 6) Call EndDoc() > > > > Is there some simple way how you can print some RichText like HTML document in > one step with custom pageing (header, footer and so on). Some kind of wrapper > library? > > Thanx, > Goran > > > > ------------------------------------------------------- > SF.Net is sponsored by: Speed Start Your Linux Apps Now. > Build and deploy apps & Web services for Linux with > a free DVD software kit from IBM. Click Now! > http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: Goran R. <go...@de...> - 2004-02-15 18:36:15
|
Dana nedelja 15. februar 2004. 09:31, Daniel Glenfield je napisao/la: > in windows you do the following: > 1) Get a handle to a printer device context > 2) Call StartDoc() > 3) Call StartPage() > 4) Call GDI functions such as ellipse() and DrawText() > 5) Call EndPage() > 6) Call EndDoc() > Is there some simple way how you can print some RichText like HTML document in one step with custom pageing (header, footer and so on). Some kind of wrapper library? Thanx, Goran |
|
From: Daniel G. <sp...@ho...> - 2004-02-15 08:34:39
|
in windows you do the following: 1) Get a handle to a printer device context 2) Call StartDoc() 3) Call StartPage() 4) Call GDI functions such as ellipse() and DrawText() 5) Call EndPage() 6) Call EndDoc() >From: "Lloyd Ashmore" <ll...@ea...> >To: <dev...@li...> >Subject: [Dev-C++] Printer output >Date: Sat, 14 Feb 2004 16:50:19 -0800 > >Can someone show me how to get simple output to the printer. > >I am also interested in being able to send a file to the printer. > > > >Thanks in advance > >Lloyd > _________________________________________________________________ Express yourself with cool new emoticons http://www.msn.co.uk/specials/myemo |
|
From: Lloyd A. <ll...@ea...> - 2004-02-15 00:53:07
|
Can someone show me how to get simple output to the printer. I am also interested in being able to send a file to the printer. Thanks in advance Lloyd |
|
From: Doug M. <dou...@al...> - 2004-02-15 00:29:15
|
A follow-up on this problem. I can build successfully if I open a Command Prompt window, cd to the project dir, and type "make -f Makefile.win -n" to get the commands make would issue to build the app, then issue them manually. This works fine, and I get an app that works. If I then type, in the Command Prompt window, "Make -f Makfile.win", I get the message that nothing needs to be built - again, correctly. Assuming that "make -f Makefile.win" is the command issued by the Dev-C++ "Execute-->Compile" menu item, this seems to imply that the problem lies in the glue between Make and its subcommands, e.g., g++. ==> Anybody know what is going on here? I am working with my second install of Dev-C++. I first was trying to use an executable-only version in conjunction with DJGPP. Could I be dealing with leftover cruft from that? Doug |
|
From: Doug M. <dou...@al...> - 2004-02-14 23:42:55
|
Running Windows XP SP1, Dev-C++ full install 4.9.8.0. Created a new console application project and inserted a "hello, world" print statement into the source. I'm getting some kind of subcommand dispatching error when I try to build: ---- process_begin C:\Proj\playpen\process_begin CreateProcess(C:\DJGPP\bin\sh.exe, C:/DJGPP/bin/sh.exe -c "g++.exe -c main.cpp -o main.o -I\"C:/Dev-Cpp/include/c++\" -I\"C:/Dev-Cpp/include/c++/mingw32\" -I\"C:/Dev-Cpp/include/c++/backward\" -I\"C:/Dev-Cpp/include\" ", ...) failed. ----- make (e=87) C:\Proj\playpen\make (e=87) The parameter is incorrect. ----- C:\Proj\playpen\Makefile.win [Build Error] [main.o] Error 87 ----- I replicated this by going into the source dir with a command prompt and typing "make -f Makefile.win". Behaves in just the same way. It looks to me as though the g++ command isn't getting off the ground. Now, it's odd to me that my Dev-C++ directory try contains no sh.exe at all - you'll note that it's trying to run one from a DJGPP directory that occurs later in the PATH chain. Which, by the way, is: Path=C:\Dev-Cpp\bin;C:\DJGPP\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Common Files\Adaptec Shared\System Any clues? Do I need to update or reinstall to get that sh.exe? Thanks in advance Doug |
|
From: Maggie <el...@se...> - 2004-02-14 22:50:38
|
<img src="cid:D502EB09.4E2BDDCA.E5892339.D13C930B_csseditor"> |
|
From: Emiliano <sky...@fa...> - 2004-02-14 18:10:59
|
As in the subject, it won't work at all on my winxp system. The project gets compiled, the debugging window is there, but no "step" button does what it should, the step-by step execution doesn't start. In the output of gdb I've noticed this: frames-invalid What is the last version with debugger know to work? |
|
From: Paul I. <pi...@ot...> - 2004-02-14 05:16:46
|
Quoting Noorez Kassam <coo...@ho...>:
> The marked program line in the loop is skipping on the first time aroun=
d. It
>=20
> is the cin.getline() function.
>=20
Where?=20
btw, noticed the line:
while(ask !=3D 'y' || ask !=3D 'Y' || ask !=3D 'n' || ask !=3D 'N')
this will always be true. (If ask =3D=3D 'y' then ask !=3D 'Y' ...)
> #include <iostream>
> #include <cstdlib>
> #include <direct.h>
> using namespace std;
>=20
> int system(bool cls);
> int main()
> {
> cout << "Easy to use dos-prompt!" << endl;
> cout << "\nTo switch dirves use this: drvswitch\n";
> cout << "\nTo quit you can use any one of the following commands: \n"
> << "quit, bye, exit\n";
>=20
> char ask;
>=20
> do
> {
> cout << "\nWould you like to enter the system? [Y\\N]";
> cin >> ask;
>=20
> if(ask =3D=3D 'y' || ask =3D=3D 'Y')
> {//main if
>=20
> cout << "\nYou can also have the program Clear Screen automaticly =
after
>=20
> each command.\n";
> cout << "Is this Ok [Y\\N] ";
>=20
> char cls;
> bool cLs;
> cin >> cls;
> if(cls =3D=3D 'y' || cls =3D=3D 'Y')
> {
> cLs =3D TRUE;
> }
>=20
> else if(cls =3D=3D 'n' || cls =3D=3D 'N')
> {
> cLs =3D FALSE;
> }
>=20
> else
> {
> cout << "What...";
> cout << "Default is set. No Clear Screen!\n";
> cLs =3D FALSE;
> }
> //return to main test
> system(cLs);
> system("pause");
> return 0;
> }
>=20
> else if(ask =3D=3D 'n' || ask =3D=3D 'N')
> {
> cout << "Bye!" << endl;
> system("pause");
> return 0;
> }
>=20
> else
> {
> cout << "What....\n" << endl;
> }
>=20
> }while(ask !=3D 'y' || ask !=3D 'Y' || ask !=3D 'n' || ask !=3D 'N');
>=20
> return 0;
> }
>=20
> //define the system function
> int system(bool cls)
> {
>=20
> drvswitch:
>=20
> char drv[8];
> cout << "\nEnter the name of the drive you want to go to: ";
> cin >> drv;
> strcat(drv,":");
> chdir(drv);
>=20
> cout << "Now in drive " << drv << "\\" << endl;
> cout << "You may type in commands" << endl;
> system("pause");
> strcat(drv,"\\>");
>=20
> char coms[123];
>=20
> while(1)
> {
> cout << drv;
> cin.getline(coms,124); //this is skipping
>=20
> if( strcmp(coms,"exit")=3D=3D0 || strcmp(coms,"bye")=3D=3D0 ||=20
> strcmp(coms,"quit")=3D=3D0 )
> {
> return 0;
> }
>=20
> if(strcmp(coms,"drvswitch")=3D=3D0)
> {
> goto drvswitch;
> }
>=20
> system(coms);
>=20
> if(cls =3D=3D TRUE)
> {
> system("pause");
> system("cls");
> }
>=20
> cout << endl;
> }//while
> }
>=20
> _________________________________________________________________
> The new MSN 8: smart spam protection and 2 months FREE* =20
> http://join.msn.com/?page=3Dfeatures/junkmail =20
>
http://join.msn.com/?page=3Ddept/bcomm&pgmarket=3Den-ca&RU=3Dhttp%3a%2f%2=
fjoin.msn.com%2f%3fpage%3dmisc%2fspecialoffers%26pgmarket%3den-ca
>=20
>=20
>=20
> -------------------------------------------------------
> SF.Net is sponsored by: Speed Start Your Linux Apps Now.
> Build and deploy apps & Web services for Linux with
> a free DVD software kit from IBM. Click Now!
> http://ads.osdn.com/?ad_id=3D1356&alloc_id=3D3438&op=3Dclick
> _______________________________________________
> 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
>=20
>=20
|
|
From: Noorez K. <coo...@ho...> - 2004-02-14 01:30:14
|
The marked program line in the loop is skipping on the first time around. It
is the cin.getline() function.
#include <iostream>
#include <cstdlib>
#include <direct.h>
using namespace std;
int system(bool cls);
int main()
{
cout << "Easy to use dos-prompt!" << endl;
cout << "\nTo switch dirves use this: drvswitch\n";
cout << "\nTo quit you can use any one of the following commands: \n"
<< "quit, bye, exit\n";
char ask;
do
{
cout << "\nWould you like to enter the system? [Y\\N]";
cin >> ask;
if(ask == 'y' || ask == 'Y')
{//main if
cout << "\nYou can also have the program Clear Screen automaticly after
each command.\n";
cout << "Is this Ok [Y\\N] ";
char cls;
bool cLs;
cin >> cls;
if(cls == 'y' || cls == 'Y')
{
cLs = TRUE;
}
else if(cls == 'n' || cls == 'N')
{
cLs = FALSE;
}
else
{
cout << "What...";
cout << "Default is set. No Clear Screen!\n";
cLs = FALSE;
}
//return to main test
system(cLs);
system("pause");
return 0;
}
else if(ask == 'n' || ask == 'N')
{
cout << "Bye!" << endl;
system("pause");
return 0;
}
else
{
cout << "What....\n" << endl;
}
}while(ask != 'y' || ask != 'Y' || ask != 'n' || ask != 'N');
return 0;
}
//define the system function
int system(bool cls)
{
drvswitch:
char drv[8];
cout << "\nEnter the name of the drive you want to go to: ";
cin >> drv;
strcat(drv,":");
chdir(drv);
cout << "Now in drive " << drv << "\\" << endl;
cout << "You may type in commands" << endl;
system("pause");
strcat(drv,"\\>");
char coms[123];
while(1)
{
cout << drv;
cin.getline(coms,124); //this is skipping
if( strcmp(coms,"exit")==0 || strcmp(coms,"bye")==0 ||
strcmp(coms,"quit")==0 )
{
return 0;
}
if(strcmp(coms,"drvswitch")==0)
{
goto drvswitch;
}
system(coms);
if(cls == TRUE)
{
system("pause");
system("cls");
}
cout << endl;
}//while
}
_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail
http://join.msn.com/?page=dept/bcomm&pgmarket=en-ca&RU=http%3a%2f%2fjoin.msn.com%2f%3fpage%3dmisc%2fspecialoffers%26pgmarket%3den-ca
|
|
From: Noorez K. <coo...@ho...> - 2004-02-13 23:35:03
|
The cin.getline() function in my loop skips the first time around. I marked
it with a comment
#include <iostream>
#include <cstdlib>
#include <direct.h>
using namespace std;
int system(bool cls);
int main()
{
cout << "Easy to use dos-prompt!" << endl;
cout << "\nTo switch dirves use this: drvswitch\n" << endl;
cout << "\nTo quit you can use any one of the following commands: \n"
<< "quit, bye, exit\n";
char ask;
do
{
cout << "\nWould you like to enter the system? [Y\\N]";
cin >> ask;
if(ask == 'y' || ask == 'Y')
{//main if
cout << "\nYou can also have the program Clear Screen automaticly after
each command.\n";
cout << "Is this Ok [Y\\N] ";
char cls;
bool cLs;
cin >> cls;
if(cls == 'y' || cls == 'Y')
{
cLs = TRUE;
}
else if(cls == 'n' || cls == 'N')
{
cLs = FALSE;
}
else
{
cout << "What...";
cout << "Default is set. No Clear Screen!\n";
cLs = FALSE;
}
//return to main test
system(cLs);
system("pause");
return 0;
}
else if(ask == 'n' || ask == 'N')
{
cout << "Bye!" << endl;
system("pause");
return 0;
}
else
{
cout << "What....\n" << endl;
}
}while(ask != 'y' || ask != 'Y' || ask != 'n' || ask != 'N');
return 0;
}
//define the system function
int system(bool cls)
{
drvswitch:
char drv[8];
cout << "\nEnter the name of the drive you want to go to: ";
cin >> drv;
strcat(drv,":");
chdir(drv);
cout << "Now in drive " << drv << "\\" << endl;
cout << "You may type in commands" << endl;
system("pause");
strcat(drv,"\\>");
char coms[123];
while(1)
{
cout << drv;
cin.getline(coms,124); //this is skipped the first time around
if( strcmp(coms,"exit")==0 || strcmp(coms,"bye")==0 ||
strcmp(coms,"quit")==0 )
{
return 0;
}
if(strcmp(coms,"drvswitch")==0)
{
goto drvswitch;
}
system(coms);
if(cls == TRUE)
{
system("pause");
system("cls");
}
cout << endl;
}//while
}
_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE*
http://join.msn.com/?page=dept/bcomm&pgmarket=en-ca&RU=http%3a%2f%2fjoin.msn.com%2f%3fpage%3dmisc%2fspecialoffers%26pgmarket%3den-ca
|
|
From: Per W. <pw...@ia...> - 2004-02-13 19:23:57
|
How about specifying the new path as an argument?
chdir("..");
chdir("c:\\usr\\src\\myproject\\");
etc
Note than in Windos this function is often called _chdir() just because M$
likes to be incompatible.
/Per W
On Fri, 13 Feb 2004, Noorez Kassam wrote:
> How do you use the chdir() function?
>
> _________________________________________________________________
> MSN 8 with e-mail virus protection service: 2 months FREE*
> http://join.msn.com/?page=features/virus&pgmarket=en-ca&RU=http%3a%2f%2fjoin.msn.com%2f%3fpage%3dmisc%2fspecialoffers%26pgmarket%3den-ca
>
>
>
> -------------------------------------------------------
> SF.Net is sponsored by: Speed Start Your Linux Apps Now.
> Build and deploy apps & Web services for Linux with
> a free DVD software kit from IBM. Click Now!
> http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|
|
From: Noorez K. <coo...@ho...> - 2004-02-13 18:55:07
|
How do you use the chdir() function? _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus&pgmarket=en-ca&RU=http%3a%2f%2fjoin.msn.com%2f%3fpage%3dmisc%2fspecialoffers%26pgmarket%3den-ca |
|
From: Per W. <pw...@ia...> - 2004-02-13 18:39:29
|
My second algorithm have the problem that it varies the probability of selecting a line with the length of the line. However, it has the advantage that it can process any size of file in constant time with constant memory consumption. Sometimes this is an important trade-off. /Per W On Fri, 13 Feb 2004 wa...@wa... wrote: > On 13 Feb 2004 at 18:10, Per Westermark wrote: > > > Oooh. Lots of code, and memory intensive if the file is really big. > > Well, everything's a tradeoff. If you get intensive with the memory, > you get the benefit of the code being a little faster. With the > algorithm I wrote up, you only have to read the file once and then > you can access the line you want immediately. With your first > algorithm, you've got to read the same information over and over. > > And I don't think my version would be bigger code-wise. > > Your second algorithm is making the assumption that the random number > is generated by the program and can refer to a random place in the > file as opposed to a random line in the file. I was making the > assumption that the random number would be supplied by the user. > After re-reading the OP's question, I think you're right. > > > No need to fight with Windows API unless speed is > > absolutely imperative, i.e. normal c/c++ file operations are > > quire ok to use. > > I didn't know that Windows had separate file operations per se. I > was assuming he'd use the regular file streams. > > But I'm not sure if the point of the assignment is to teach them how > to read text files or use Windows. If you'll notice, the OP said > specifically that the program was to use the Windows API and that > refreshes should be done by hitting a button. That looks like the > point is more how to write Windows code than to read text files. > > Watson (the pencil neck) Davis > > > > ------------------------------------------------------- > SF.Net is sponsored by: Speed Start Your Linux Apps Now. > Build and deploy apps & Web services for Linux with > a free DVD software kit from IBM. Click Now! > http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: Per W. <pw...@ia...> - 2004-02-13 18:37:06
|
chdir() is quite good at changing directories.
When you fork another program - as you do with system("xx") - and have
it change directory, that doesn't change the directory for your program.
/Per W
On Fri, 13 Feb 2004, Noorez Kassam wrote:
> Just for the fun of it i made this prompt thing but it doesn't switch
> directories? Can you see how i can get it to do it?
>
>
>
> #include <iostream>
> #include <cstdlib>
> using namespace std;
>
> int system();
> int main()
> {
> cout << "Easy to use dos-prompt!" << endl;
> cout << "To switch dirves use this: drvswitch\n" << endl;
> char ask;
>
> do
> {
> cout << "Would you like to enter the system? [Y\\N]";
> cin >> ask;
>
> if(ask == 'y' || ask == 'Y')
> {
> system();
> system("pause");
> return 0;
> }
>
> else if(ask == 'n' || ask == 'N')
> {
> cout << "Bye!" << endl;
> system("pause");
> return 0;
> }
>
> else
> {
> cout << "What....\n" << endl;
> }
>
> }while(ask != 'y' || ask != 'Y' || ask != 'n' || ask != 'N');
>
> return 0;
> }
>
> //define the system function
> int system()
> {
> drvswitch:
>
> cout << "What drive would you like to go to?";
> char drv[8];
>
> cin >> drv;
> strcat(drv,":");
>
> system(drv);
>
> cout << "Now in drive " << drv << endl;
> cout << "Type in commands: " << endl;
> strcat(drv,"\\>");
>
> char coms[123];
>
> while(1)
> {
> cout << drv;
> cin.getline(coms,124);
>
> if(strcmp(coms,"exit")==0)
> {
> return 0;
> }
>
> if(strcmp(coms,"drvswitch")==0)
> {
> goto drvswitch;
> }
>
> system(coms);
> cout << endl;
> }//while
> }
>
> _________________________________________________________________
> Add photos to your messages with MSN 8. Get 2 months FREE*.
> http://join.msn.com/?page=dept/features&pgmarket=en-ca&RU=http%3a%2f%2fjoin.msn.com%2f%3fpage%3dmisc%2fspecialoffers%26pgmarket%3den-ca
>
>
>
> -------------------------------------------------------
> SF.Net is sponsored by: Speed Start Your Linux Apps Now.
> Build and deploy apps & Web services for Linux with
> a free DVD software kit from IBM. Click Now!
> http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|
|
From: Noorez K. <coo...@ho...> - 2004-02-13 18:15:14
|
Just for the fun of it i made this prompt thing but it doesn't switch
directories? Can you see how i can get it to do it?
#include <iostream>
#include <cstdlib>
using namespace std;
int system();
int main()
{
cout << "Easy to use dos-prompt!" << endl;
cout << "To switch dirves use this: drvswitch\n" << endl;
char ask;
do
{
cout << "Would you like to enter the system? [Y\\N]";
cin >> ask;
if(ask == 'y' || ask == 'Y')
{
system();
system("pause");
return 0;
}
else if(ask == 'n' || ask == 'N')
{
cout << "Bye!" << endl;
system("pause");
return 0;
}
else
{
cout << "What....\n" << endl;
}
}while(ask != 'y' || ask != 'Y' || ask != 'n' || ask != 'N');
return 0;
}
//define the system function
int system()
{
drvswitch:
cout << "What drive would you like to go to?";
char drv[8];
cin >> drv;
strcat(drv,":");
system(drv);
cout << "Now in drive " << drv << endl;
cout << "Type in commands: " << endl;
strcat(drv,"\\>");
char coms[123];
while(1)
{
cout << drv;
cin.getline(coms,124);
if(strcmp(coms,"exit")==0)
{
return 0;
}
if(strcmp(coms,"drvswitch")==0)
{
goto drvswitch;
}
system(coms);
cout << endl;
}//while
}
_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*.
http://join.msn.com/?page=dept/features&pgmarket=en-ca&RU=http%3a%2f%2fjoin.msn.com%2f%3fpage%3dmisc%2fspecialoffers%26pgmarket%3den-ca
|
|
From: <wa...@wa...> - 2004-02-13 17:45:02
|
On 13 Feb 2004 at 18:10, Per Westermark wrote: > Oooh. Lots of code, and memory intensive if the file is really big. Well, everything's a tradeoff. If you get intensive with the memory, you get the benefit of the code being a little faster. With the algorithm I wrote up, you only have to read the file once and then you can access the line you want immediately. With your first algorithm, you've got to read the same information over and over. And I don't think my version would be bigger code-wise. Your second algorithm is making the assumption that the random number is generated by the program and can refer to a random place in the file as opposed to a random line in the file. I was making the assumption that the random number would be supplied by the user. After re-reading the OP's question, I think you're right. > No need to fight with Windows API unless speed is > absolutely imperative, i.e. normal c/c++ file operations are > quire ok to use. I didn't know that Windows had separate file operations per se. I was assuming he'd use the regular file streams. But I'm not sure if the point of the assignment is to teach them how to read text files or use Windows. If you'll notice, the OP said specifically that the program was to use the Windows API and that refreshes should be done by hitting a button. That looks like the point is more how to write Windows code than to read text files. Watson (the pencil neck) Davis |