dev-cpp-users Mailing List for Dev-C++ (Page 216)
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: Noorez K. <coo...@ho...> - 2004-05-24 00:31:45
|
Help me with the problems with the program. It's sort of like an easy
dos-prompt.
1)The chdir function doesn't work
2)When you start a program, the program name stays on the blue banner at the
top of the window, even when the program as ended.
#include <iostream>
#include <cstdlib>
#include <direct.h>
#include <string>
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 = FALSE;
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;
cin.ignore();
strcat(drv,":");
chdir(drv); /*chdir function that doesn't work*/
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);
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
}
_________________________________________________________________
STOP MORE SPAM with the MSN Premium and get 2 months FREE*
http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines
|
|
From: Axel B. <new...@th...> - 2004-05-23 11:39:02
|
A.Buschhüter wrote: > I whant to create an advanture game. > To store all the datas I whant to use a data base. > Well, MySQL also seems not to be the right DB for use with my project... I really think so, too. > Which data base I can use instead - and how ??? ah well ... I really don't think you need a complete enterprise grade sql database for your adventure game :-) why not trying - berkeley db: http://www.sleepycat.com - sqlite: http://www.sqlite.org pro's: both are embedded and thus simply part of your program without the need of an external server (mysql) the docs of both are quite good, the berkeley docs are excellent (I used it in several projects to up to now) cons: berkeley is a key -> value db, without any own language. hope that it helps. ciao, axel. |
|
From: Per W. <pw...@ia...> - 2004-05-23 09:47:58
|
It isn't enough to specify which directory a library is in. You must add a -lxx to the link parameters, where xx is the name of the library your project should use. /Per W On Sun, 23 May 2004, Alf C Stockton wrote: > > I have developed a C GTK+2 program in Linux which I now need to port to Windows. > I decided to use Dev-C++ and all compiles well but despite the library, > gtk-win32-2.0 being in the Dev-C++\lib directory and the Dev-C++ project > library directory pointing to this directory the link fails telling me > gtk_main_exit cannot be found. > What have I forgotten to do ? > > > > --- > > Regards, > Alf Stockton www.stockton.co.za > > A day for firm decisions!!!!! Or is it? > > > ------------------------------------------------------- > This SF.Net email is sponsored by: Oracle 10g > Get certified on the hottest thing ever to hit the market... Oracle 10g. > Take an Oracle 10g class now, and we'll give you the exam FREE. > http://ads.osdn.com/?ad_id=3149&alloc_id=8166&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: Alf C S. <al...@st...> - 2004-05-23 09:40:18
|
I have developed a C GTK+2 program in Linux which I now need to port to Windows. I decided to use Dev-C++ and all compiles well but despite the library, gtk-win32-2.0 being in the Dev-C++\lib directory and the Dev-C++ project library directory pointing to this directory the link fails telling me gtk_main_exit cannot be found. What have I forgotten to do ? --- Regards, Alf Stockton www.stockton.co.za A day for firm decisions!!!!! Or is it? |
|
From: <wa...@wa...> - 2004-05-23 04:27:55
|
On 23 May 2004 at 3:07, Nancy Alvarez wrote: > Hi > > Someone it is able to tell me that signifies this message: > > " A violation of acces (Absence of segmenta=E7=E3o) occurred in its > program " I would assume that to be a bad pointer. It might also be an array that is too large. Watson Davis |
|
From: Nancy A. <nai...@ho...> - 2004-05-23 03:09:24
|
<html><div style='background-color:'><DIV class=RTE>Hi</DIV> <DIV class=RTE> </DIV> <DIV class=RTE>Someone it is able to tell me that signifies this message:</DIV> <DIV class=RTE> </DIV> <DIV class=RTE>" A violation of acces (Absence of segmentação) occurred in its program "</DIV> <DIV class=RTE> </DIV> <DIV class=RTE> </DIV> <DIV class=RTE>Thanks</DIV></div><br clear=all><hr>Charla con tus amigos en línea mediante MSN Messenger: <a href="http://g.msn.com/8HMAES/2728??PS=47575">Haz clic aquí</a> </html> |
|
From: Ewald H. <in...@ho...> - 2004-05-22 21:53:06
|
> No conversion is needed. Actually, your problem is that you ARE > converting it to a string. The << operator is overloaded to convert the > integer in a string representation of the value. You should be using the > .write() method of the stream. > > Check this: > http://www.cplusplus.com/ref/iostream/ostream/write.html Awesome! Funny my C++ manual does not mention this write method. Guess it's time for a new one then. Thank you for all the answers. Thank you Ewald Horn Proprietor/Eienaar : Horn Labs Cell/Sel : 083 519 1615 Website : http://www.hornlabs.co.za Email/E-pos : in...@ho... |
|
From: Per W. <pw...@ia...> - 2004-05-22 21:26:43
|
Just do: int i = 10; (char*)i; and write out sizeof(i) bytes. /Per W On Sat, 22 May 2004, Ewald Horn wrote: > >In fopen you can specify a binary stream with the b modifier in the > >wanted open type (glibc reference). > > > I do open the file as binary, using an IO stream. That's not the problem. I > need to know how to convert an integer value into it's 4 byte equivalent. > For instance 39184 is $00009910 and I would like to write [00,00,99,10] as > hex values to my file. I was just wondering if there was a way to dump an > entire struct to a file and then read it back later. > > > Regards > Ewald Horn > Proprietor/Eienaar : Horn Labs > Cell/Sel : 083 519 1615 > Website : http://www.hornlabs.co.za > Email/E-pos : in...@ho... > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: Oracle 10g > Get certified on the hottest thing ever to hit the market... Oracle 10g. > Take an Oracle 10g class now, and we'll give you the exam FREE. > http://ads.osdn.com/?ad_id=3149&alloc_id=8166&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: Daniel K. O. <dan...@ya...> - 2004-05-22 21:23:34
|
Ewald Horn wrote: >I do open the file as binary, using an IO stream. That's not the problem. I >need to know how to convert an integer value into it's 4 byte equivalent. > > No conversion is needed. Actually, your problem is that you ARE converting it to a string. The << operator is overloaded to convert the integer in a string representation of the value. You should be using the .write() method of the stream. Check this: http://www.cplusplus.com/ref/iostream/ostream/write.html >For instance 39184 is $00009910 and I would like to write [00,00,99,10] as >hex values to my file. > > In that case you'll need the << operator with the "hex" manipulator. http://www.cplusplus.com/ref/iostream/ios_base/_dec_hex_oct.html Daniel K. O. |
|
From: Ewald H. <in...@ho...> - 2004-05-22 21:03:44
|
>In fopen you can specify a binary stream with the b modifier in the >wanted open type (glibc reference). I do open the file as binary, using an IO stream. That's not the problem. I need to know how to convert an integer value into it's 4 byte equivalent. For instance 39184 is $00009910 and I would like to write [00,00,99,10] as hex values to my file. I was just wondering if there was a way to dump an entire struct to a file and then read it back later. Regards Ewald Horn Proprietor/Eienaar : Horn Labs Cell/Sel : 083 519 1615 Website : http://www.hornlabs.co.za Email/E-pos : in...@ho... |
|
From: <sp...@po...> - 2004-05-22 20:12:45
|
Hello, I wonder if there are some people who could reproduce webupdate fatal crash in 4989 and would like to help me fix that? First test build is here: http://castlesofpoland.com/dev-cpp/wu/ Please let me know. -- Marek Januszewski |
|
From: Billiam <bon...@ya...> - 2004-05-22 18:40:49
|
Anyone know how to make DLLs, or a good tutorial for them or something like that? --------------------------------- Do you Yahoo!? Yahoo! Domains - Claim yours for only $14.70/year |
|
From: Per W. <pw...@ia...> - 2004-05-22 10:58:53
|
Well, I would still recommend that you try and add the -lstdc++ parameter to your linker settings. /Per W On Fri, 21 May 2004, Vivek Jishtu wrote: > I even tried out c:/dev-cpp/lib/*.a but am still getting that error. And yes these funtions are in libstdc++.a but as far as i know that file is automatically linked. > > Regards, > Vivek Jishtu > > Per Westermark <pw...@ia...> wrote: > Ever tried to just go to your lib directory and try > grep _Unwind_SjLj_Unregister * > > A tip: libstdc++ > > /Per W > > On Fri, 21 May 2004, Vivek Jishtu wrote: > > > > > I am trying to compile my project and am getting the following linker error. Which libraries am I missing > > > > > > [Linker error] undefined reference to `_Unwind_SjLj_Register' > > [Linker error] undefined reference to `_Unwind_SjLj_Resume' > > [Linker error] undefined reference to `_Unwind_SjLj_Unregister' > > [Linker error] undefined reference to `__gxx_personality_sj0' > > > > Regards, > > > > Vivek Jishtu > > ------------------------------------------------------------------------ > > Make your programs with the ease of BASIC and > > Power of C++ usiing EzBasic > > http://ezbasic.sf.net/ > > ------------------------------------------------------------------------- > > > > > > > > --------------------------------- > > Do you Yahoo!? > > Yahoo! Domains - Claim yours for only $14.70/year > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: Oracle 10g > Get certified on the hottest thing ever to hit the market... Oracle 10g. > Take an Oracle 10g class now, and we'll give you the exam FREE. > http://ads.osdn.com/?ad_id=3149&alloc_id=8166&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 > > --------------------------------- > Do you Yahoo!? > Yahoo! Domains - Claim yours for only $14.70/year |
|
From: Vivek J. <viv...@ya...> - 2004-05-22 06:57:04
|
I even tried out c:/dev-cpp/lib/*.a but am still getting that error. And yes these funtions are in libstdc++.a but as far as i know that file is automatically linked. Regards, Vivek Jishtu Per Westermark <pw...@ia...> wrote: Ever tried to just go to your lib directory and try grep _Unwind_SjLj_Unregister * A tip: libstdc++ /Per W On Fri, 21 May 2004, Vivek Jishtu wrote: > > I am trying to compile my project and am getting the following linker error. Which libraries am I missing > > > [Linker error] undefined reference to `_Unwind_SjLj_Register' > [Linker error] undefined reference to `_Unwind_SjLj_Resume' > [Linker error] undefined reference to `_Unwind_SjLj_Unregister' > [Linker error] undefined reference to `__gxx_personality_sj0' > > Regards, > > Vivek Jishtu > ------------------------------------------------------------------------ > Make your programs with the ease of BASIC and > Power of C++ usiing EzBasic > http://ezbasic.sf.net/ > ------------------------------------------------------------------------- > > > > --------------------------------- > Do you Yahoo!? > Yahoo! Domains - Claim yours for only $14.70/year ------------------------------------------------------- This SF.Net email is sponsored by: Oracle 10g Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id=3149&alloc_id=8166&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 --------------------------------- Do you Yahoo!? Yahoo! Domains - Claim yours for only $14.70/year |
|
From: Les F. <lh...@xt...> - 2004-05-22 04:43:08
|
A.Buschhüter wrote: >Hi, >I whant to create an advanture game. >To store all the datas I whant to use a data base. > >First I tried to implement MySQL but don't get it to work... :( >I've got the latest MySQL version (incl. MyODBC) and the MySQL-DevPak installed. >I used to test it with the sample projekt from the DevPak but can't get any connections to the >data base... > >Well, MySQL also seems not to be the right DB for use with my project... > > I am sure that MySQL is more than adequate. Like most databases, you need to read the instructions for it and configure a username/password for access rights (the default admin user and password from installation will probably do for testing purposes). The details of this user, the host and database name all need to be used in the database connection string to get a connection to work. I do not know which example code you followed, but I am sure it contained a connection string or a series of connection parameters, which you modified to match your local database settings. Those details and the results of your debugging from attempting to run the code, may be useful information when you ask here for assistance. There are other issues tho, if you want a quick light database back end to an application, maybe SQLite or similar would be better for a distributed app, as the MySQL database must be installed and executed as a separate background service. -- Les Ferguson |
|
From: Nicholas O. R. <exc...@mi...> - 2004-05-22 03:14:27
|
I've never actually found a function that would tell whether or not there is another character on the buffer... you might be able to rig up something with the functions in wincon.h or conio.h; I've never tried. However, you can use "cin.peek()" to read the next character on the input buffer without extracting it from the buffer. You can also extract a character with "cin.get()" and then put it back onto the buffer with "cin.putback()" or "cin.unget()". You could probably also use "cin.sync()" instead of "cin.ignore()" -- it doesn't require that any characters be on the buffer before it sweeps them all away, so you don't have to worry about it eating input meant for a "cin.getline()". Nicholas |
|
From: Jorge A. <jor...@ep...> - 2004-05-22 03:10:12
|
In fopen you can specify a binary stream with the b modifier in the=20 wanted open type (glibc reference). Ewald Horn escribi=F3: > Hi, > =20 > I use the attached code to output a struct to a binary file.=20 > Outputting character arrays is no problem, but how do I output an=20 > integer value in bytes and not a string value ? I will be using the=20 > Win32 platform, 32-bit integer, so portability is no issue. Is there=20 > an easy way to do it that would simply output the required 4 bytes ?=20 > My current test solution converts a number to a 10 digit string,=20 > padded with 0's like this : 10 would be 0000000010, but it is clumsy! > =20 > Regards > Ewald Horn > Proprietor/Eienaar : Horn Labs > Cell/Sel : 083 519 1615 > Website : http://www.hornlabs.co.za > Email/E-pos : in...@ho... <mailto:in...@ho...> > =20 > //[code] > =20 > #include <fstream> > #include <string.h> > =20 > using namespace std; > =20 > struct MyStruct > { > char name[40]; > char surname[40]; > int age; > };=20 > =20 > // global > ofstream myFile("tmp.out",ios::out | ios::binary); > =20 > void writeStruct(MyStruct); > int main() > { > MyStruct data[3] =3D {0}; > =20 > for (int i =3D 0; i < 3; i++) > writeStruct(data[i]); > =20 > myFile.close(); > =20 > return 0; > }=20 > =20 > void writeStruct(MyStruct strc) > { > for (int i =3D 0; i < sizeof(strc.name); i++) > myFile.put(strc.name[i]); > =20 > for (int i =3D 0; i < sizeof(strc.surname); i++) > myFile.put(strc.surname[i]); > // problem area follows =20 > myFile << strc.age; > }=20 > //[end code] |
|
From: Daniel K. O. <dan...@ya...> - 2004-05-21 23:49:07
|
A.Buschhüter wrote: >I whant to create an advanture game. >To store all the datas I whant to use a data base. > > Is it really needed? Can't you just use a binary file like almost every game does? >First I tried to implement MySQL but don't get it to work... :( >I've got the latest MySQL version (incl. MyODBC) and the MySQL-DevPak installed. >I used to test it with the sample projekt from the DevPak but can't get any connections to the >data base... > > Did you try first running the MySQL database (so you'll have something to connect to)? Just a guess, because you didn't mention that your MySQL server is running in your e-mail. >Well, MySQL also seems not to be the right DB for use with my project... > > >Which data base I can use instead - and how ??? > > Unless you really need multiple clients accessing your database at the same time, you'll probably be satisfied with SQLite (it doesn't need a db server, so it's faster). That is, if you really need a SQL database. Daniel K. O. |
|
From: Nicholas O. R. <exc...@mi...> - 2004-05-21 23:19:56
|
Before each call to cin.getline(), add this line:
cin.ignore();
The reason is this: When you use "cin>>" to take in data, it reads
everything except the newline ('\n') character, which it leaves on the
input buffer. When you use "cin.getline()" to take in data, it reads
everything including the newline character, which it throws away. Each
time you have a call to "cin.getline()" after a call to "cin>>", the
getline function picks up the newline left on the buffer by "cin>>" and
interprets that as the end of the input, thus exiting the getline
function. By putting a "cin.ignore()" between the "cin>>" and the
"cin.getline()", you remove the pesky leftover newline character from
the buffer. It is important to note that if you use "cin.ignore()"
before a getline when there is no leftover newline character sitting on
the buffer, the next character you type in will be taken in by the
"cin.ignore()" and not the "cin.getline()"... i.e. it will look like the
first character of your input got 'eaten'.
Nicholas
|
|
From: Noorez K. <coo...@ho...> - 2004-05-21 22:34:14
|
There are lines skipping in my program. I have marked them with comments
#include <iostream>
#include <cstdlib>
#include <string>
using namespace std;
int main(int args, char* pszArgs[])
{
if(strcmp(pszArgs[1],"-nt")== 0)
{
system("cls");
cout << "Welcome to the easy program opener!\n";
cout << "Hear is a list of programs that can be easy opened\n\n";
cout << "To quit enter 0 or nothing for a program choice\n";
cout << "1. Microsoft Office\n";
cout << "2. Microsoft Paint\n";
cout << "3. Calculator\n";
cout << "4. Internet Explorer\n";
int choice;
while(1)
{
choice = 0;
cout << "\nEnter the number of your choice: ";
cin >> choice;
if(choice == 0)
{
cout << "Exiting easy opener...\n";
//Sleep(1000);
return 0;
}
if(choice == 1)
{
system("start winword");
}
if(choice ==2)
{
system("mspaint");
}
if(choice ==3)
{
//should beable to...
system("calc");
}
if(choice ==4)
{
char site[123];
char intern[] ="start iexplore ";
cout << "Enter site: ";
cin.getline(site,123); /*this line skips*/
strcat(intern,site);
system(intern);
//delete site;
}
}//while
}//nt operating system
if(strcmp(pszArgs[1],"-me")==0)
{
system("cls");
cout << "Welcome to the easy program opener!\n";
cout << "Hear is a list of programs that can be easy opened\n\n";
cout << "To quit enter 0 or nothing for a program choice\n";
cout << "1. Microsoft Office\n";
cout << "2. Microsoft Paint\n";
cout << "3. Calculator\n";
cout << "4. Internet Explorer\n";
int choice;
while(1)
{
cout << endl << "Enter choice: ";
cin >> choice;
if(choice ==0)
{
cout << "Exiting Easy Opener..\n";
//Sleep(1000);
return 0;
}
if(choice ==1)
{
system("start winword");
}
if(choice==2)
{
system("pbrush");
}
if(choice==3)
{
system("calc");
}
if(choice ==4)
{
cout << "Enter site: ";
char site[235];
char intern[]="start iexplore ";
cin.getline(site,123);/*this line skips*/
strcat(intern,site);
system(intern);
}
}
}
return 0;
}
_________________________________________________________________
http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines
|
|
From: <A_B...@gm...> - 2004-05-21 22:17:27
|
Hi, I whant to create an advanture game. To store all the datas I whant to use a data base. First I tried to implement MySQL but don't get it to work... :( I've got the latest MySQL version (incl. MyODBC) and the MySQL-DevPak installed. I used to test it with the sample projekt from the DevPak but can't get any connections to the data base... Well, MySQL also seems not to be the right DB for use with my project... Which data base I can use instead - and how ??? Or can someone tell me how to connect to an MySQL DB, maybe with an example source ??? thx, Acki |
|
From: Ewald H. <in...@ho...> - 2004-05-21 20:26:59
|
Hi, I use the attached code to output a struct to a binary file. Outputting = character arrays is no problem, but how do I output an integer value in = bytes and not a string value ? I will be using the Win32 platform, = 32-bit integer, so portability is no issue. Is there an easy way to do = it that would simply output the required 4 bytes ? My current test = solution converts a number to a 10 digit string, padded with 0's like = this : 10 would be 0000000010, but it is clumsy! Regards Ewald Horn Proprietor/Eienaar : Horn Labs Cell/Sel : 083 519 1615 Website : http://www.hornlabs.co.za Email/E-pos : in...@ho... //[code] #include <fstream> #include <string.h> using namespace std; struct MyStruct { char name[40]; char surname[40]; int age; }; =20 // global ofstream myFile("tmp.out",ios::out | ios::binary); void writeStruct(MyStruct); int main() { MyStruct data[3] =3D {0}; =20 for (int i =3D 0; i < 3; i++) writeStruct(data[i]); =20 myFile.close(); =20 return 0; } =20 void writeStruct(MyStruct strc) { for (int i =3D 0; i < sizeof(strc.name); i++) myFile.put(strc.name[i]); for (int i =3D 0; i < sizeof(strc.surname); i++) myFile.put(strc.surname[i]); // problem area follows =20 myFile << strc.age; } =20 //[end code] |
|
From: Per W. <pw...@ia...> - 2004-05-21 17:25:21
|
Ever tried to just go to your lib directory and try grep _Unwind_SjLj_Unregister * A tip: libstdc++ /Per W On Fri, 21 May 2004, Vivek Jishtu wrote: > > I am trying to compile my project and am getting the following linker error. Which libraries am I missing > > > [Linker error] undefined reference to `_Unwind_SjLj_Register' > [Linker error] undefined reference to `_Unwind_SjLj_Resume' > [Linker error] undefined reference to `_Unwind_SjLj_Unregister' > [Linker error] undefined reference to `__gxx_personality_sj0' > > Regards, > > Vivek Jishtu > ------------------------------------------------------------------------ > Make your programs with the ease of BASIC and > Power of C++ usiing EzBasic > http://ezbasic.sf.net/ > ------------------------------------------------------------------------- > > > > --------------------------------- > Do you Yahoo!? > Yahoo! Domains - Claim yours for only $14.70/year |
|
From: Vivek J. <viv...@ya...> - 2004-05-21 16:59:38
|
I am trying to compile my project and am getting the following linker error. Which libraries am I missing [Linker error] undefined reference to `_Unwind_SjLj_Register' [Linker error] undefined reference to `_Unwind_SjLj_Resume' [Linker error] undefined reference to `_Unwind_SjLj_Unregister' [Linker error] undefined reference to `__gxx_personality_sj0' Regards, Vivek Jishtu ------------------------------------------------------------------------ Make your programs with the ease of BASIC and Power of C++ usiing EzBasic http://ezbasic.sf.net/ ------------------------------------------------------------------------- --------------------------------- Do you Yahoo!? Yahoo! Domains - Claim yours for only $14.70/year |
|
From: Vlada D. <dj...@im...> - 2004-05-21 12:19:16
|
----- Original Message -----
From: "Manish Shrivastava" <msh...@qu...>
To: "Vlada Djurovic" <dj...@im...>; "casper"
<oz...@op...>; <dev...@li...>
Sent: Friday, May 21, 2004 12:31 PM
Subject: RE: [Dev-C++] linking .h file and .cpp file
> Is it a standard that all declarations shud go into .h and implementations
> in .cpp (or just a convention). Though I see that most compiler doesn't
> allow to compile .h and even if they do, they give a linking error for
> main() (even if it is present in .h)
>
> Manish
Well, I don't know if it's a standard. I don't really have much experience,
but I've seen in many places that this is the recomended way to do things. I
think it represents the separation of interface( declaration) from
implementation (definitions), which is much talked about in OOP books. You
could also put both declarations and definitions in one file, but it reduces
readability, reusability, and probably some other problems.
Anyway, somebody with more experience will probably explain this better than
me. :-)
> -----Original Message-----
> From: dev...@li...
> [mailto:dev...@li...] On Behalf Of Vlada
> Djurovic
> Sent: Friday, May 21, 2004 3:46 PM
> To: casper; dev...@li...
> Subject: Re: [Dev-C++] linking .h file and .cpp file
>
>
> ----- Original Message -----
> From: "casper" <oz...@op...>
> To: <dev...@li...>
> Sent: Friday, May 21, 2004 11:15 AM
> Subject: [Dev-C++] linking .h file and .cpp file
>
>
> > Hi,
> >
> > I have a file with .h extension which includes my main
program.
> I
> > have put
> >
> > #include "logfuncion.cpp"
> >
> > In the .h extension file. And inside the .cpp file I have put
> the
> > function definitions.
> >
> > Both files are in the same directory, but the .h file failed to compile
> > because of the error
> >
> > Undefined "logfuncion.cpp"
> >
> > How could I solve the problem?
> >
> > Thanks in advance.
> >
> It should be the other way around. Your function declarations should go in
> .h file, and their definitions in .cpp.
> For example:
> ---myheader.h---
> class Myclass{
> public void f();
> public int g(int x);
> }
> --end of myheader.h---
> And in mymain.cpp you should do:
>
> ----mymain.cpp------
> #include <myheader.h>
> void Myclass::f(){
> //define function
> }
> int Myclass::g(int x){
> //define function
> }
> ----end mymain.cpp----
>
>
>
> -------------------------------------------------------
|