dev-cpp-users Mailing List for Dev-C++ (Page 646)
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: Flavio de S. <fla...@se...> - 2001-11-18 02:54:18
|
Thanks for your response.
I used this parameter to compile the program. But I got the following=20
different message:
g++: -lwsock32: linker input file unused since linking not done
I think this is the right way to follow, but I am still missing something.=
=20
Any ideas?
Tks again,
Flavio.
At 09:01 18/11/01 +1100, you wrote:
>Hi,
>
>I'm not experienced with winsock programming ... but ... did you link
>the winsock library??
>
>Somewhere where you set linker options you will need to add -lwsock32
>
>Ray Smith
>
>
>----- Original Message -----
>From: Fl=E1vio de Souza <fla...@se...>
>To: <dev...@li...>
>Sent: Sunday, November 18, 2001 5:36 AM
>Subject: [Dev-C++] Linking error (help please!)
>
>
> > Hi !
> >
> > I am trying to compile and linking this simple code:
> >
> > #include <winsock.h> // winsock.h always needs to be included
> > #include <stdio.h>
> > #include <windows.h>
> >
> > file://Prototypen
> > int startWinsock(void);
> >
> > int main(int argc, char *argv[])
> > {
> > long rc;
> > rc=3DstartWinsock();
> > if(rc!=3D0)
> > {
> > printf("Error: startWinsock, error code: %d\n",rc);
> > return 1;
> > }
> > else
> > {
> > printf("Winsock started!\n");
> > }
> > return 0;
> > }
> >
> > int startWinsock(void)
> > {
> > WSADATA wsa;
> > return WSAStartup(MAKEWORD(1,1),&wsa);
> > }
> >
> >
> > But I got this error:
> >
> > c:\meus documentos\projetos\sistema de
> >
>e-mails\source\socketconnection\socket_test\socket_t2.o(.text+0xad):socket_=
t
>2.cpp:
> > undefined reference to `WSAStartup@8'
> >
> > I don't know what causes this, do you have any ideas?
> >
> > Probably it is a silly error.
> >
> > Tks,
> >
> > Flavio.
> > Flavio de Souza
> > fla...@ne...
> > ICQ:78458203
> >
>
>
>---------------------------------------------------------------------------=
-
>----
>
>
> >
> > ---
> > Outgoing mail is certified Virus Free.
> > Checked by AVG anti-virus system (http://www.grisoft.com).
> > Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
> >
>
>
>
>---
>Incoming mail is certified Virus Free.
>Checked by AVG anti-virus system (http://www.grisoft.com).
>Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
|
|
From: dx F. <vin...@ed...> - 2001-11-18 01:28:13
|
I havent actually got the win32 API Reference. I have downloaded the ful 12mb of it but at the end, the file was corrupted. I guess I'll have to start downloading again. What I actually want to do is find out how do some shell replacements(preferably, ones that sit over the default shell,explorer.exe) which know the Windows that are available at the time. Then you could switch to them in a handy little toolbar the program provides. Note that I actually meant available windows of applications running at the moment. The first solution I got from a friend was to use 'HOOKS', but I didn't really know what they are and how to use them. Anyone there has a good solution? __________________________________ www.edsamail.com |
|
From: dx F. <vin...@ed...> - 2001-11-18 01:28:13
|
It is quite a good solution, incrementing the values would have appeared faster than converting it from one to the other. However, my concern when I was writing the program was to get the equivalent values of 124 - 255. If I could only know the number represented by 124, then I could increment it one by one. However, that would require me to got first through 2 - 124 before I actually print out the numbers. But yours is a good solution. But I'm not saying it is the one solution that one could follow. There are many other solutions out there(including mine) that one can turn to which would satisfy the problem(s). Lastly, my concern when I wrote the code for that was to create classes that can do type conversion like Decimal = Octal, which would convert Decimal number to Octal number(base 8). Also, doing operations on the numbers was part of my objective w/c I abandoned when I saw a futile search for a solution back then. __________________________________ www.edsamail.com |
|
From: <cuo...@iw...> - 2001-11-17 20:46:35
|
You should have used sizeof() to get the size of your array. strlen() is for the use of getting the size of string. For instance, string A =3D "Yourname"; the strlen(A) would be: 8 plus NULL. Visit iWon.com - the Internet's largest guaranteed cash giveaway! Click here now for your "Thank You" gift: http://www.iwon.com/giftcenter/0,2612,,00.html?t_id=3D20157 |
|
From: de S. <fla...@se...> - 2001-11-17 18:36:56
|
Hi !
I am trying to compile and linking this simple code:
#include <winsock.h> // winsock.h always needs to be included
#include <stdio.h>
#include <windows.h>
//Prototypen
int startWinsock(void);
int main(int argc, char *argv[])
{
long rc;
rc=startWinsock();
if(rc!=0)
{
printf("Error: startWinsock, error code: %d\n",rc);
return 1;
}
else
{
printf("Winsock started!\n");
}
return 0;
}
int startWinsock(void)
{
WSADATA wsa;
return WSAStartup(MAKEWORD(1,1),&wsa);
}
But I got this error:
c:\meus documentos\projetos\sistema de
e-mails\source\socketconnection\socket_test\socket_t2.o(.text+0xad):socket_t2.cpp:
undefined reference to `WSAStartup@8'
I don't know what causes this, do you have any ideas?
Probably it is a silly error.
Tks,
Flavio.
Flavio de Souza
fla...@ne...
ICQ:78458203
|
|
From: Jason H. <jas...@bt...> - 2001-11-17 14:09:26
|
I admit that I have no real knowledge of doing that, but I think I have found some information in the Win32 Reference that would be a good place to start. If you haven't already downloaded it then I recomend you do - there's a link at the Dev-C++ resource site. Look up the function Process32First(). That entry contains links to the other functions you need with it to obtain information about the currently running processes. To focus a particular window then you will want SetForegroundWindow() most likely, although you will need to find out the handle of the window you want to focus. I think possibly that 'th32ProcessID', which you get with Process32First() and related functions, is a valid handle that can be used, although you should check that. Remember that one program will probably have more than one process associated with it. I imagine that to find the tray icons you will need to go through the Processes and find which are set to be in the tray, which I don't know how you do in the first place. I know that you still have a lot of work from there, but at least it's a start. There may be an easier way of doing these things of course. Please tell me if any of this helps. It looks like an interesting thing to try out. Jason. ----- Original Message ----- From: "dx FX" <vin...@ed...> To: "Dev-C++ mailing list" <dev...@li...> Sent: Sunday, November 18, 2001 3:27 AM Subject: [Dev-C++] Detecting running applications > How do I get the names and handles of the programs/applications currently running and how do I turn Focus to them? also, how do I detect, and get the tray icons on the system tray? > > __________________________________ > www.edsamail.com > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users |
|
From: dx F. <vin...@ed...> - 2001-11-17 11:17:39
|
How do I get the names and handles of the programs/applications currently running and how do I turn Focus to them? also, how do I detect, and get the tray icons on the system tray? __________________________________ www.edsamail.com |
|
From: Jason H. <jas...@bt...> - 2001-11-17 07:08:31
|
You can use the shift operator for the range of values 0 to 31, but you probably won't need more: result = 1 << power; As a define it would be something like: #define POW2TON(power) 1 << power but I don't see any reason to do that. Macros are best avoided. Jason. ----- Original Message ----- From: "Albert Vilella Bertran" <vil...@ya...> To: <dev...@li...> Sent: Friday, November 16, 2001 6:16 PM Subject: [Dev-C++] #define for 2^n > Super-simple-question: > > Does anyone know how to implement the function 2^n into a "#define"? > > thanks > > > > _______________________________________________________________ > Do You Yahoo!? > Yahoo! Messenger > Comunicación instantánea gratis con tu gente. > http://messenger.yahoo.es > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users |
|
From: <cuo...@iw...> - 2001-11-17 05:19:59
|
You need to overload shift operator '<<'. Visit iWon.com - the Internet's largest guaranteed cash giveaway! Click here now for your "Thank You" gift: http://www.iwon.com/giftcenter/0,2612,,00.html?t_id=3D20157 |
|
From: Jason H. <jas...@bt...> - 2001-11-17 02:50:43
|
The function strlen() is for working with strings and not general arrays.
You are lucky that the program didn't lock up or crash when you tried it. It
works by detecting the NULL terminator on the end of the string. As your
arrays are of fixed size then the sizeof operator will give you the numbers
you need, but that won't work for an array who's size is unknown at compile
time (i.e. dynamically allocated arrays). Don't forget that sizeof returns
the number of 'bytes' in a variable, object or array (calculated at compile
time).
Maybe a vector would be better suited to your needs?
Jason.
----- Original Message -----
From: "Julio Lajara" <ju2...@ya...>
To: <dev...@li...>
Sent: Saturday, November 17, 2001 2:31 AM
Subject: [Dev-C++] problem with strlen( )...
> #include <iostream.h>
> #include <stdlib.h>
> #include <string.h>
>
> int main()
> {
>
> char array[10]= {1,2,3,4,5,6,7,8,9,10};
> char array2[2]= {1,2};
> char array3[3]= {1,3,30};
>
> cout << "\n";
>
> for(unsigned short int i = 0; i < 10; i++)
> cout << "array " << i+1 << ": " <<
> static_cast<int>(array[i]) << "\n";
>
> cout << "array length: " << strlen(array) <<
> "\n";
> cout << "array2 length: " << strlen(array2) <<
> "\n";
> cout << "array3 length: " << strlen(array3) <<
> "\n\n";
> system("PAUSE");
> return 0;
> }
>
> why does strlen return 11 for array, 13 for array2 and
> 7 for array3??
>
> =====
> Julio
>
> __________________________________________________
> Do You Yahoo!?
> Find the one for you at Yahoo! Personals
> http://personals.yahoo.com
>
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|
|
From: Julio L. <ju2...@ya...> - 2001-11-17 02:31:43
|
#include <iostream.h>
#include <stdlib.h>
#include <string.h>
int main()
{
char array[10]= {1,2,3,4,5,6,7,8,9,10};
char array2[2]= {1,2};
char array3[3]= {1,3,30};
cout << "\n";
for(unsigned short int i = 0; i < 10; i++)
cout << "array " << i+1 << ": " <<
static_cast<int>(array[i]) << "\n";
cout << "array length: " << strlen(array) <<
"\n";
cout << "array2 length: " << strlen(array2) <<
"\n";
cout << "array3 length: " << strlen(array3) <<
"\n\n";
system("PAUSE");
return 0;
}
why does strlen return 11 for array, 13 for array2 and
7 for array3??
=====
Julio
__________________________________________________
Do You Yahoo!?
Find the one for you at Yahoo! Personals
http://personals.yahoo.com
|
|
From: graeme <gr...@dr...> - 2001-11-17 02:16:15
|
I don't think that you can do it using a #define but try an inline function instead. Graeme |
|
From: David N. <dne...@mi...> - 2001-11-16 18:43:59
|
I can't believe this guy suckered all of you into completing his CS assignment for him... |
|
From: <vil...@ya...> - 2001-11-16 18:19:43
|
Super-simple-question: Does anyone know how to implement the function 2^n into a "#define"? thanks _______________________________________________________________ Do You Yahoo!? Yahoo! Messenger Comunicación instantánea gratis con tu gente. http://messenger.yahoo.es |
|
From: ctiger <cpp...@ar...> - 2001-11-16 15:24:18
|
Hi! I have a question about Dev-C++, or better, about GCC: How can I make GCC export functions in .EXE files, that is, what is the GCC equivalent to Microsoft's __declspec(dllexport) or the Module Definition File (.DEF) mechanism? It is especially important that the resulting file will be an independent EXE file, not a DLL. Thanks in advance for any useful replies ctiger Please respond to cpp...@ar... if you know anything that might help. |
|
From: Lorenzo <co...@in...> - 2001-11-16 14:47:33
|
> C:\WINDOWS\TEMP\ccdGLyfb.o(.text+0x50):mpp0202.cpp: undefined reference to `cout' you must use g++ and not gcc ---------------------------------------------------------------------------- --- If debugging is the process of removing bugs, then programming must be the process of putting them in. ---------------------------------------------------------------------------- --- |
|
From: Ioannis V. <no...@ya...> - 2001-11-16 14:18:08
|
You forgot the #include <iostream>. =20 =20 =20 Ioannis=20 =20 * Ioannis Vranos * Programming pages: http://www.noicys.f2s.com <http://www.noicys.f2s.com/>=20 * Alternative URL: http://run.to/noicys -----Original Message----- From: dev...@li... [mailto:dev...@li...] On Behalf Of Adrimort Sent: Friday, November 16, 2001 1:52 PM To: dev...@li... Subject: [Dev-C++] A BIG BIG PROBLEM (AT LESS I THINK SO) Hi!!! This is my 1st mail to the group. First of all sorry about my English. I expect you can help me: =20 I have used DevCpp for 2 months and all was perfect. But last week it started not to work properly. It compiles perfectly, showing the number of mistakes (yeah, I'm learning C++) I have, but when I have no mistakes, and the program is supposed to execute the program, an error message saying Compiler and linker output appears. The full message is this: C:\WINDOWS\TEMP\ccdGLyfb.o(.text+0x50):mpp0202.cpp: undefined reference to `cout' C:\WINDOWS\TEMP\ccdGLyfb.o(.text+0x55):mpp0202.cpp: undefined reference to `ostream::operator<<(char const *)' C:\WINDOWS\TEMP\ccdGLyfb.o(.text+0x64):mpp0202.cpp: undefined reference to `cin' C:\WINDOWS\TEMP\ccdGLyfb.o(.text+0x69):mpp0202.cpp: undefined reference to `istream::operator>>(int &)' C:\WINDOWS\TEMP\ccdGLyfb.o(.text+0x89):mpp0202.cpp: undefined reference to `cout' C:\WINDOWS\TEMP\ccdGLyfb.o(.text+0x8e):mpp0202.cpp: undefined reference to `ostream::operator<<(char const *)' C:\WINDOWS\TEMP\ccdGLyfb.o(.text+0x9d):mpp0202.cpp: undefined reference to `cin' C:\WINDOWS\TEMP\ccdGLyfb.o(.text+0xa2):mpp0202.cpp: undefined reference to `istream::operator>>(int &)' C:\WINDOWS\TEMP\ccdGLyfb.o(.text+0xe4):mpp0202.cpp: undefined reference to `cout' C:\WINDOWS\TEMP\ccdGLyfb.o(.text+0xe9):mpp0202.cpp: undefined reference to `ostream::operator<<(char const *)' C:\WINDOWS\TEMP\ccdGLyfb.o(.text+0xf4):mpp0202.cpp: undefined reference to `ostream::operator<<(int)' C:\WINDOWS\TEMP\ccdGLyfb.o(.text+0xff):mpp0202.cpp: undefined reference to `ostream::operator<<(char const *)' What happens?? What can I do?? I have tried reinstalling the program and even installing 4.01 version, but it doesn't work. Thanks for all. Adri=E1n Fern=E1ndez=20 |
|
From: Daniel G. <sp...@ho...> - 2001-11-16 12:12:26
|
<html><div style='background-color:'><DIV> <P>Have you forgotten to put #include <iostream.h> at the beginning of your program?</P> <P>make sure the actual header file can be found by the compiler also.<BR><BR></P></DIV> <DIV></DIV> <DIV></DIV>>From: "Adrimort" <ADR...@TE...> <DIV></DIV>>To: <DEV...@LI...> <DIV></DIV>>Subject: [Dev-C++] A BIG BIG PROBLEM (AT LESS I THINK SO) <DIV></DIV>>Date: Fri, 16 Nov 2001 12:51:51 +0100 <DIV></DIV>> <DIV></DIV>>Hi!!! This is my 1st mail to the group. First of all sorry about my English. I expect you can help me: <DIV></DIV>> <DIV></DIV>>I have used DevCpp for 2 months and all was perfect. But last week it started not to work properly. It compiles perfectly, showing the number of mistakes (yeah, I'm learning C++) I have, but when I have no mistakes, and the program is supposed to execute the program, an error message saying Compiler and linker output appears. The full message is this: <DIV></DIV>>C:\WINDOWS\TEMP\ccdGLyfb.o(.text+0x50):mpp0202.cpp: undefined reference to `cout' <DIV></DIV>> <DIV></DIV>>C:\WINDOWS\TEMP\ccdGLyfb.o(.text+0x55):mpp0202.cpp: undefined reference to `ostream::operator<<(char const *)' <DIV></DIV>> <DIV></DIV>>C:\WINDOWS\TEMP\ccdGLyfb.o(.text+0x64):mpp0202.cpp: undefined reference to `cin' <DIV></DIV>> <DIV></DIV>>C:\WINDOWS\TEMP\ccdGLyfb.o(.text+0x69):mpp0202.cpp: undefined reference to `istream::operator>>(int &)' <DIV></DIV>> <DIV></DIV>>C:\WINDOWS\TEMP\ccdGLyfb.o(.text+0x89):mpp0202.cpp: undefined reference to `cout' <DIV></DIV>> <DIV></DIV>>C:\WINDOWS\TEMP\ccdGLyfb.o(.text+0x8e):mpp0202.cpp: undefined reference to `ostream::operator<<(char const *)' <DIV></DIV>> <DIV></DIV>>C:\WINDOWS\TEMP\ccdGLyfb.o(.text+0x9d):mpp0202.cpp: undefined reference to `cin' <DIV></DIV>> <DIV></DIV>>C:\WINDOWS\TEMP\ccdGLyfb.o(.text+0xa2):mpp0202.cpp: undefined reference to `istream::operator>>(int &)' <DIV></DIV>> <DIV></DIV>>C:\WINDOWS\TEMP\ccdGLyfb.o(.text+0xe4):mpp0202.cpp: undefined reference to `cout' <DIV></DIV>> <DIV></DIV>>C:\WINDOWS\TEMP\ccdGLyfb.o(.text+0xe9):mpp0202.cpp: undefined reference to `ostream::operator<<(char const *)' <DIV></DIV>> <DIV></DIV>>C:\WINDOWS\TEMP\ccdGLyfb.o(.text+0xf4):mpp0202.cpp: undefined reference to `ostream::operator<<(int)' <DIV></DIV>> <DIV></DIV>>C:\WINDOWS\TEMP\ccdGLyfb.o(.text+0xff):mpp0202.cpp: undefined reference to `ostream::operator<<(char const *)' <DIV></DIV>> <DIV></DIV>>What happens?? What can I do?? I have tried reinstalling the program and even installing 4.01 version, but it doesn't work. <DIV></DIV>> <DIV></DIV>>Thanks for all. <DIV></DIV>> <DIV></DIV>>Adrián Fernández <DIV></DIV>> <DIV></DIV></div><br clear=all><hr>Get your FREE download of MSN Explorer at <a href='http://go.msn.com/bql/hmtag_itl_EN.asp'>http://explorer.msn.com</a><br></html> |
|
From: carlos D. M. <cg...@wo...> - 2001-11-16 11:50:58
|
Why offence? My english is horrible, I know that. Sorry. I was thinking about it after surrender and then I realized that there was another way for do what I wanted, I did it and worked!!! I made some proves to the first program, too; taking some pieces of it inside other program, so I could see qhat part of the program was failing: and I discover it is a problem due to the fact of being a console program: reading from the original file and writing in the output file worked right, the problem was the opening: the program generated errors in the moment of opening the input file, but giving no advice (I wrote after the infile.open the lines for prove that and no advice; in previous trials it worked once it did not open the file) Forgive my english, I hope improve it. Thanks. |
|
From: Adrimort <adr...@te...> - 2001-11-16 11:47:53
|
Hi!!! This is my 1st mail to the group. First of all sorry about my = English. I expect you can help me: I have used DevCpp for 2 months and all was perfect. But last week it = started not to work properly. It compiles perfectly, showing the number = of mistakes (yeah, I'm learning C++) I have, but when I have no = mistakes, and the program is supposed to execute the program, an error = message saying Compiler and linker output appears. The full message is = this: C:\WINDOWS\TEMP\ccdGLyfb.o(.text+0x50):mpp0202.cpp: undefined reference = to `cout' C:\WINDOWS\TEMP\ccdGLyfb.o(.text+0x55):mpp0202.cpp: undefined reference = to `ostream::operator<<(char const *)' C:\WINDOWS\TEMP\ccdGLyfb.o(.text+0x64):mpp0202.cpp: undefined reference = to `cin' C:\WINDOWS\TEMP\ccdGLyfb.o(.text+0x69):mpp0202.cpp: undefined reference = to `istream::operator>>(int &)' C:\WINDOWS\TEMP\ccdGLyfb.o(.text+0x89):mpp0202.cpp: undefined reference = to `cout' C:\WINDOWS\TEMP\ccdGLyfb.o(.text+0x8e):mpp0202.cpp: undefined reference = to `ostream::operator<<(char const *)' C:\WINDOWS\TEMP\ccdGLyfb.o(.text+0x9d):mpp0202.cpp: undefined reference = to `cin' C:\WINDOWS\TEMP\ccdGLyfb.o(.text+0xa2):mpp0202.cpp: undefined reference = to `istream::operator>>(int &)' C:\WINDOWS\TEMP\ccdGLyfb.o(.text+0xe4):mpp0202.cpp: undefined reference = to `cout' C:\WINDOWS\TEMP\ccdGLyfb.o(.text+0xe9):mpp0202.cpp: undefined reference = to `ostream::operator<<(char const *)' C:\WINDOWS\TEMP\ccdGLyfb.o(.text+0xf4):mpp0202.cpp: undefined reference = to `ostream::operator<<(int)' C:\WINDOWS\TEMP\ccdGLyfb.o(.text+0xff):mpp0202.cpp: undefined reference = to `ostream::operator<<(char const *)' What happens?? What can I do?? I have tried reinstalling the program and = even installing 4.01 version, but it doesn't work. Thanks for all. Adri=E1n Fern=E1ndez=20 |
|
From: Luigi S. <gi...@li...> - 2001-11-16 05:56:19
|
Hi, I would name the program "harmonic.cpp", rather than "harmonic.c", because it contains some instructions that are not part of C, like the ones used for printing. To compile and link, I would try the following command: "path\bin\g++ -Ipath\include -Ipath\include\g++ -o harmonic.o harmonic.cpp" In the above you should replace "path" with the path where you have installed Dev-C++, for example if Dev-C++ is in "c:\programs\devcpp", then your command should be: "c:\programs\devcpp\bin\g++ -Ic:\programs\devcpp\include -Ic:\programs\devcpp\include\g++ -o harmonic.exe harmonic.c" Of course you should issue the command from within a DOS box and being in the directory which contains the file "harmonic.cpp". If the above does not work let me know, also if you wish to carry out the above task with some shorter command also let me know, I have a couple of programs that can help doing so. At 16.41 15/11/01 -0500, Evan Hempel wrote about Cuong2001's post: >I assume you mean to compile it, and that the program is in a file called >harmonic.c > >Since dev-cpp uses gcc as it's compiler, I think you would youise the >following command, from the file's directory: > >gcc harmonic.c -o harmonic.exe > >however, since it is a windows compiler, it might need other options? :-) -- gisan gi...@li... |
|
From: Jason H. <jas...@bt...> - 2001-11-16 05:32:22
|
Sorry to be a nay-sayer, but it is quite feasable to have a number system of
base one. If you skipped that fact in the program I expect that marks would
be lost. In fact some of the earliest counting systems are unary (base one)
counting systems. To count to 3 (decimal) you would write 111 (unary). It's
like counting with matchsticks or lines. To help counting you can group
together certain amounts, such as putting a line through 4 (1111) to make 5.
It's because it became cumbersome to represent larger values that symbols
representing larger values were created. Roman numeral are still in use
today.
As I understand the question you have to count through all the possible
combinations from 1 to the largest figure available in n digits, in a number
base specified by m. 'm' can be between 0 and 11 (i.e. 1 to 10), and n can
be 1 to 80 (no more than 80 digits long).
If you look at couting in any base then there is a ripple effect from right
to left, each time the least significant digit reaches it's maximum value,
the next least significant increases by one, and the least significant
starts again from it's lowest value. The same happens in each digit until
all digits reach thier maximum, or to be more precise, when all digits have
rolled over to thier original values. All you have to do is achieve this
ripple effect and display each intermediary stage, as the number increases.
In fact there is no real reason for you to count up the numbers in sequence,
but that may be easier to get your head around.
Assuming you use an array to store the digits and work from right to left in
the array then to display all you do is skip over all zero values until you
reach a non-zero value and then output each value in turn one after the
other, that way on screen they appear as one whole number, even though you
are working with individual digit's.
I'm tempted to make a working program and present it to you, but as graeme
says, you should try for yourself. Maybe what we have said will give you
some indication as to how to go about it. What I have said is essentialy the
same as what graeme suggested, but just using different words that I hope
will help you figure it out.
You will probably have to detect specially the unary situation. Also don't
forget to check the entered values of m and n so that they fall in the range
specified in the question, or you'll lose marks.
Jason
----- Original Message -----
From: "graeme" <gr...@dr...>
To: <dev...@li...>
Cc: <do...@ho...>
Sent: Friday, November 16, 2001 3:27 AM
Subject: [Dev-C++] Print numbers up to n digits wide of number system base
m.
> m is the base system (1 < m < 11) // Base 1 doesn't make much sense...
> n is the number of digits (0 < n < 81)
>
> Set up an array of 80 chars and initialise it so that the each element is
> zero except the first which is set to 1
> // This is so that when you print it it will give 100000 for a six digit
> number
> repeat until all the numbers have been displayed
>
> add one to the least significant digit (hence the n-1 digit in the zero
> based array)
> BUT {that good old c command :-) } if the current digit is equal to m -
1
> then
> set the current digit to 0 and try with the n-2 digit // I've left
it
> particularly vague for you to work out
> // If you think about it you can use this to cause you repeat loop
> termination condition.
>
> Print out the number ( or each digit in the array from 0 to n-1) //
Maybe
> add some pauses to allow the screen to be read
> end repeat // All the numbers have been displayed have a break.
>
>
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|
|
From: Brian P. <BP...@go...> - 2001-11-16 05:25:51
|
ok ... hint #2 you need /, %, pow, 2 for loops, and a if however my answer gives you one extra number, but I guess I could put it in a vector and pop the top. if you want the code to look at ... e-mail me or the list and put more of these kind of questions up, I love them. -----Original Message----- From: "Dario Peralta"<do...@ho...> To: dev...@li... Date: Thu Nov 15 04:10:37 PST 2001 Subject: [Dev-C++] Print numbers up to n digits wide of number system base m. > >/* >Let m be an integer, greater than zero but less than eleven. Numerical >strings, in which each digit is greater or equal to 0 but less than m, are >numbers of the number system in the base m. The numbers 10110 and 1981, for >example, are numbers of the number system in the base the 10, but only the >first one is a number of the number system in the base 2. The zeros at the >beginning of the number are leading zeros, unless the number is 0. > >Write a program that reads the integers m and n, and outputs all numbers of >the number system in the base m containing n digits at the most, and without >leading zeros. Each number may be output only once. > >You may assume that m is greater than 0, but less than 11, and that n is >greater than 0 but less than 81. > >The numbers should be output on consecutive lines, one number per line >*/ > >I've been banging my head over this problem since last week, and i'm no >closer to an answer than i was when i started. > >I find myself always coming back to the idea of implementing a bidimensional >array as such: nsys[n][m] > >But i can't figure out the system of loops and conditions that would >correctly solve this problem. > >I'm hopelessly stuck. I'll keep banging my head, but i doubt i'll answer >this. > >I thought i'd ask for some help. Some clever hints would be better than the >straight answer, as i would like to figure out as much of it by myself as i >can. But i really need help. > >Thanks... > >adios, >biterman. > ><<That government is best which governs the least... that government is best >which governs not at all.>> > > >_________________________________________________________________ >Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp > > >_______________________________________________ >Dev-cpp-users mailing list >Dev...@li... >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users ___________________________________________________ GO.com Mail Get Your Free, Private E-mail at http://mail.go.com |
|
From: graeme <gr...@dr...> - 2001-11-16 03:27:59
|
m is the base system (1 < m < 11) // Base 1 doesn't make much sense...
n is the number of digits (0 < n < 81)
Set up an array of 80 chars and initialise it so that the each element is
zero except the first which is set to 1
// This is so that when you print it it will give 100000 for a six digit
number
repeat until all the numbers have been displayed
add one to the least significant digit (hence the n-1 digit in the zero
based array)
BUT {that good old c command :-) } if the current digit is equal to m - 1
then
set the current digit to 0 and try with the n-2 digit // I've left it
particularly vague for you to work out
// If you think about it you can use this to cause you repeat loop
termination condition.
Print out the number ( or each digit in the array from 0 to n-1) // Maybe
add some pauses to allow the screen to be read
end repeat // All the numbers have been displayed have a break.
|
|
From: Jason H. <jas...@bt...> - 2001-11-16 00:19:49
|
Ooops, I sent this directly to Mr. Chuong rather than to the Dev-C++ mailing
list. It would be nicer if the reply address with mailing list items was
automatically back to the mailing list. Here's what I said:
I have corrected a few errors that I can see, but I've not tested the
outcome so I'll leave that to you. Note that passing as an array and passing
as a pointer equate to the same thing.
#include <iostream.h>
#include <stdlib.h>
#include <stdio.h>
//--------------------------------------------------------------------------
--
----
// array passed as pointer
float sum_array( float *A, int len )
{
float s = 0;
for( int i = 0; i < len; ++i )
s += A[i];
return s;
}
// array passed as array of unspecified length
float average_array( float A[], int len )
{
return sum_array( A, len )/len;
}
//--------------------------------------------------------------------------
--
----
void main( int argc, char **argv )
{
if( argc != 2 ) /* there will always be at least 1 in argc as the name
of the executable counts as an argument */
{
cerr << "Usage: " << argv[0] << " number" << endl;
cerr <<"int argc: "<<argc;
getchar();
exit(0);
}
int n = atoi( argv[1] ); /* you don't check that a valid result was
given, but I assume that you will be giving correct commands */
//float H[n];
/* this is illegal in all but the latest C standard (C99), you cannot
allocate an array with a variable size. You should use dynamic allocation,
as follows */
float *H = new float[n]; /* I'm not absolutely sure of syntax off the
top of my head, so check it works.*/
for( int i = 1; i <= n; ++i )
H[i-1] = 1.0/static_cast<float>(i); /* this is a better way of making
the result float, i.e. use a float literal and cast the integer into a
float, although it would probably have been an implicit cast anyway */
cout << "harmonic number " << n << ": " << sum_array( H, n ) << endl;
cout << "average 1/i up to " << n << ": " << average_array( H, n ) <<
endl;
system("PAUSE");
delete[] H; // don't forget to delete array when finished with it
exit(0);
}
I hope those little pointers help you. I'll leave it to you to debug what I
have written. I don't think I have made any mistakes (maybe some typing
errors) but I didn't have time to check.
Jason.
----- Original Message -----
From: <Cuo...@ao...>
To: <dev...@li...>
Sent: Thursday, November 15, 2001 6:41 AM
Subject: [Dev-C++] Using Command Line to Execute program
> Please show me step-by-step how to use DevC++ to run a program through
> Command Line method fpr the following program. Thank you!!!!!!!!!!!!!!
>
>
> #include <iostream.h>
> #include <stdlib.h>
> #include <stdio.h>
>
>
//--------------------------------------------------------------------------
--
>
> ----
> // array passed as pointer
>
> float sum_array( float *A, int len )
> {
> float s = 0;
> for( int i = 0; i < len; ++i )
> s += A[i];
> return s;
> }
>
> // array passed as array of unspecified length
>
> float average_array( float A[], int len )
> {
> return sum_array( A, len )/len;
> }
>
>
//--------------------------------------------------------------------------
--
>
> ----
> void main( int argc, char **argv )
> {
> if( argc != 1 )
> {
> cerr << "Usage: " << argv[0] << " number" << endl;
> cerr <<"int argc: "<<argc;
> getchar();
> exit(0);
> }
>
> int n = atoi( argv[1] );
>
> float H[n];
>
> for( int i = 1; i <= n; ++i )
> H[i-1] = 1/float(i);
>
> cout << "harmonic number " << n << ": " << sum_array( H, n ) <<
endl;
> cout << "average 1/i up to " << n << ": " << average_array( H, n ) <<
> endl;
>
> exit(0);
> }
>
> //--------------------------------
> ------------------------------------------------
>
>
>
>
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|