dev-cpp-users Mailing List for Dev-C++
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
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
1
(24) |
2
(12) |
3
(10) |
4
(5) |
5
(30) |
|
6
(6) |
7
(18) |
8
(17) |
9
(36) |
10
(22) |
11
(7) |
12
(3) |
|
13
(10) |
14
(31) |
15
(6) |
16
(18) |
17
(18) |
18
(24) |
19
(9) |
|
20
(11) |
21
(43) |
22
(18) |
23
(32) |
24
(51) |
25
(38) |
26
(14) |
|
27
(12) |
28
(5) |
29
(24) |
30
(31) |
31
(12) |
|
|
|
From: Anders E. <am...@sw...> - 2002-10-23 22:10:06
|
Hello Colin, Wednesday, October 23, 2002, 2:00:38 PM, you wrote: CL> Hello, CL> With Dev-C++ 4.9.6.0 the config file directory has changed for NT, 2000 and CL> XP. You need to update your vUpdate to have it look for the correct directory. CL> If you cannot autoupdate it, you can download it from : CL> http://www.zero47.com/devfiles/vUpdate.exe The problem is that the new vUpdate is the version that can't find devcpp.cfg! I'll guess that it's using SHGetSpecialFolderLocation with CSIDL_APPDATA but somehow it will not find the file!!! Maybe the file has changed name? I have copied the devcpp.cfg file to the directory specified for CSIDL_APPDATA and since I am on a Swedish Windows I have also copied it to C:\Docume~1\User\Local Settings\Application Data But ... So I, and many with me, would appreciate if someone that has access to the code can have a look and see what's goin on! -- Best regards, Anders mailto:am...@sw... |
|
From: Mitchell, T. (DLM) <Tam...@dl...> - 2002-10-23 19:53:58
|
I need help.
I am not sure where my typo is. Both .txt files exist.
Can anyone please help me.
Thanks
#include<fstream>
#include<iostream>
using namespace std;
void main(){
ifstream fin;
ofstream fout;
fin.open("Eb.txt");
/*if(fin==0){
cout << " input file xx.txt not found "<< endl;
}*/
fout.open("y.txt");
int a[10],i;
for(i=0;i<10;i++)
fin >> a[i];
for(i=0;i<10;i++)
fout << a[i] << endl;
}
Tamra Y. Mitchell
Database & Operating Systems Analyst
412-222-8203 - Work
412-996-9078 - Cell
|
|
From: Louis G. <lg...@ya...> - 2002-10-23 19:03:56
|
Marc and Per: Thanks for the dialog from both of you. As a C++ newbie I learned new ideas about C++ database setup from your discussion of Rob's problem --- Rob Peacock <py...@ea...> wrote: > At 05:07 PM 10/23/02 +0200, Per Westermark wrote: > >Well, Rob's original code snippet was strict C, so any use of templates > >and classes might be outside the scope :-) > > For this project, I would like to keep it as close to ANSI C as possible > because I know more about C than C++ and I will be attempting to port it > for use on a Mac as well. > > >Template-based code with multiple sort orders normally requires a > >smart-pointer implementation, which isn't trivial. > > Since I am fairly new at this, I would like to keep it as simple as > possible. Maybe after I get more experience I will improve on what I > already have working. As it is, I already have a challenge ahead of me > determining how to talk directly to my custom hardware via the serial > port > in NT. (Mac is easy by comparison - a couple of calls to the > Pascal-based > toolbox.) > > >So in this case, a truly general application should probably store the > >data in a MySQL database instead, but such a solution is clearly out of > >scope of the original question... > > If I knew how to interface my program with MySQL, I would certainly do > it. > Unfortunately, the only way I know how to interface with MySQL is via > Apache for building web sites :) > > >/Per W > > >On Wed, 23 Oct 2002, Marc Heiligers wrote: > >> Ultimately , I would prefer to use a CString class for name and other > string > >> type properties. Also use TCHAR instead of char, etc. etc. etc. > CString > >> classes generally have a copy constructor so the result of GetName() > would > >> not be able to change the value in the instance. > > Mark, > > I appreciate your detailed help. It is the attention to details, and the > use of examples, that helps people learn and understand. Unfortunately, > I > am smart enough to realize that most everything you said went clear over > my > head :( > > Thank you very much for the assistance. > > Per, > > Once again you have given me something to think about with the MySQL. As > my > C instructor once said, there are almost as many ways of doing something > as > their are programmers and who is to say who has the 'most correct' way > of > solving the problem. > > Thanks again, > > --->Rob > > > ------------------------------------------------------- > This sf.net email is sponsored by: Influence the future > of Java(TM) technology. Join the Java Community > Process(SM) (JCP(SM)) program now. > http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0002en > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users __________________________________________________ Do you Yahoo!? Y! Web Hosting - Let the expert host your web site http://webhosting.yahoo.com/ |
|
From: Rob P. <py...@ea...> - 2002-10-23 18:46:33
|
At the risk of getting slammed, "Me Too" --->Rob From: "Frank Wagner" <F.W...@wi...> >I'm working on NT4SP6 and run vUpdate. >After updating a new start of vUpdate leads to an Error that said: >Error: devcpp.cfg not found Please check ... >I checked these folders and I copied devcpp to all that directories I >thought they could take affect. >Devcpp.cfg is in the root directory of Dev-C++ and at serveral >locations in C:\WinNt\profiles...\Application Data. >But the Error is still present even if I restart Dev-C++. |
|
From: Rob P. <py...@ea...> - 2002-10-23 18:31:00
|
At 05:07 PM 10/23/02 +0200, Per Westermark wrote: >Well, Rob's original code snippet was strict C, so any use of templates >and classes might be outside the scope :-) For this project, I would like to keep it as close to ANSI C as possible because I know more about C than C++ and I will be attempting to port it for use on a Mac as well. >Template-based code with multiple sort orders normally requires a >smart-pointer implementation, which isn't trivial. Since I am fairly new at this, I would like to keep it as simple as possible. Maybe after I get more experience I will improve on what I already have working. As it is, I already have a challenge ahead of me determining how to talk directly to my custom hardware via the serial port in NT. (Mac is easy by comparison - a couple of calls to the Pascal-based toolbox.) >So in this case, a truly general application should probably store the >data in a MySQL database instead, but such a solution is clearly out of >scope of the original question... If I knew how to interface my program with MySQL, I would certainly do it. Unfortunately, the only way I know how to interface with MySQL is via Apache for building web sites :) >/Per W >On Wed, 23 Oct 2002, Marc Heiligers wrote: >> Ultimately , I would prefer to use a CString class for name and other string >> type properties. Also use TCHAR instead of char, etc. etc. etc. CString >> classes generally have a copy constructor so the result of GetName() would >> not be able to change the value in the instance. Mark, I appreciate your detailed help. It is the attention to details, and the use of examples, that helps people learn and understand. Unfortunately, I am smart enough to realize that most everything you said went clear over my head :( Thank you very much for the assistance. Per, Once again you have given me something to think about with the MySQL. As my C instructor once said, there are almost as many ways of doing something as their are programmers and who is to say who has the 'most correct' way of solving the problem. Thanks again, --->Rob |
|
From: Colin L. <ha...@bl...> - 2002-10-23 18:24:13
|
Hello, With Dev-C++ 4.9.6.0 the config file directory has changed for NT, 2000 and XP. You need to update your vUpdate to have it look for the correct directory. If you cannot autoupdate it, you can download it from : http://www.zero47.com/devfiles/vUpdate.exe Greetings, Colin Laplace On Wednesday 23 October 2002 13:16, you wrote: > Hello, > > I'm working on NT4SP6 and run vUpdate. > After updating a new start of vUpdate leads to an Error that said: > > Error: devcpp.cfg not found Please check ... > > I checked these folders and I copied devcpp to all that directories I > thought they could take affect. > Devcpp.cfg is in the root directory of Dev-C++ and at serveral > locations in C:\WinNt\profiles...\Application Data. > But the Error is still present even if I restart Dev-C++. > > How can this be fixed? > > Greetings > > Frank > > > ------------------------------------------------------- > This sf.net emial is sponsored by: Influence the future > of Java(TM) technology. Join the Java Community > Process(SM) (JCP(SM)) program now. > http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0002en > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users |
|
From: <h.r...@gm...> - 2002-10-23 15:29:40
|
> I am experiencing the problem with the DOS console (promt) window, when
> the programme is executed the DOS console is automatically closed, I
> tried changing the settings, etc, but the same thing happends, the DOS
> output window is diseapearing, as I heard the same problem from people
> using other compilers under Windows, I am wondering if anybody knows a
> solution to this problem,
>
> thanks in advance,
>
> Dario
>
Hi,
there are many solutions. One is put
system("Pause") at the end of your program.
BTW: you get the following program if you create a console program in
dev-c++:
#include <iostream>
#include <stdlib.h>
int main(int argc, char *argv[])
{
system("PAUSE");
return 0;
}
Horst
--
+++ GMX - Mail, Messaging & more http://www.gmx.net +++
NEU: Mit GMX ins Internet. Rund um die Uhr für 1 ct/ Min. surfen!
|
|
From: Per W. <pw...@ia...> - 2002-10-23 15:08:30
|
Well, Rob's original code snippet was strict C, so any use of templates
and classes might be outside the scope :-)
The problem with giving advice is always what conceptual level to use.
Template-based code with multiple sort orders normally requires a
smart-pointer implementation, which isn't trivial.
So in this case, a truly general application should probably store the
data in a MySQL database instead, but such a solution is clearly out of
scope of the original question...
About the void. Yes, in C++ it's considered unneccesary noise, best to
leave out of the code. The original use of func(void) was actually a
bit of a kludge to allow parametrized function prototypes in C, as opposed
to the original KR style.
/Per W
On Wed, 23 Oct 2002, Marc Heiligers wrote:
> Hi Per W,
>
> You're quite right about the GetXXX() methods. Early morning... Coding not
> always best.
>
> Ultimately , I would prefer to use a CString class for name and other string
> type properties. Also use TCHAR instead of char, etc. etc. etc. CString
> classes generally have a copy constructor so the result of GetName() would
> not be able to change the value in the instance.
>
> I did not know that about void. I knew it could be omitted in C++, but is it
> convention to omit it?
>
> As for the template container, I did say vector or similar. I guess it
> depends on what features you need. Rob was talking about traversing the
> "array" using for loops. I think a vector is quite handy for that. The point
> was to get away from statically defined arrays.
>
> _____________________________
> Marc Heiligers
>
>
> -----Original Message-----
> From: Per Westermark [mailto:pw...@ia...]
> Sent: 23 October 2002 02:55 PM
> To: Marc Heiligers
> Cc: 'Rob Peacock'; dev...@li...
> Subject: RE: [Dev-C++] Question about structs...
>
>
> What use is a Setname(char *szName) when the GetName() have already sent out
> the pointer to the m_szName array? The GetName() method should be declared
> const char* GetName() const; The First const to say that the returned
> pointer may not be used to change the stored name. The second const to say
> that the GetName() method doesn't change anything inside the class CEmployee
> when called.
>
> In fact, all GetXX() methods should be written as:
> type GetXX() const;
>
> Since this is C++, and not C, all methods not taking a parameter should be
> written with empty parentheses. It is only in C, that the void keyword is
> needed.
>
> If using template containers, it might also be an idea to use the map
> container instead, to allow direct sort and location of entries on customer
> id.
>
> /Per W
>
> On Wed, 23 Oct 2002, Marc Heiligers wrote:
>
> > Hi,
> > If you build an array of structs as you have below, you have a fixed
> > number of records. It might be a good idea to build your data
> > structure (and I suggest using a class which you can then use to
> > validate data and perform operations on your data) and then storing
> > your "records" in a STL vector, or similar. This allows you to
> > dymaically change the number of employee, etc. etc. etc. So you'd get
> > something like:
> >
> > A file called "employee.h", for example _____________________________
> > #include <vector>
> >
> > using namespace std;
> >
> > class CEmployee
> > {
> > public:
> > CEmployee(); //constructor - init code
> > ~CEmployee(); //destructor - clean up code
> > public:
> > BOOL SetId(int nId); //Get and set methods for props
> > int GetId(void);
> > BOOL SetAge(int nAge);
> > int GetAge(void);
> > BOOL SetSalary(float fSalary);
> > float GetSalary(void);
> > BOOL SetName(char *szName);
> > char* GetName(void);
> > private:
> > //private properties
> > int m_nId;
> > int m_nAge;
> > float m_fSalary;
> > char m_szName[25];
> > }
> >
> > typedef vector<CEmployee*> EMPLOYEES_DATABASE;
> >
> > _____________________________
> > And then use
> > _____________________________
> > #include <iostream>
> > #include "employee.h"
> >
> > int main(void)
> > {
> > EMPLOYEES_DATABASE database;
> > CEmployee *employee = new CEmployee(); //Create new employee
> > employee->SetName("Marc Heiligers"); //Set employee properties
> > employee->SetAge(27);
> > employee->SetId(0);
> > employee->SetSalary(1000000.00);
> > database.push_back(employee); //Add employee to
> > end of vector
> > .
> > .
> > .
> > cout << "Number of employees: " << database.size() << endl;
> >
> > //Use an iterator to loop through all employees and print their
> > names.
> > EMPLOYEES_DATABASE::iterator iter;
> > for (iter = database.begin(); iter != database.end; iter++)
> > {
> > employee = *iter;
> > cout << "Name: " << employee->GetName() << endl;
> > }
> > return 0;
> > }
> > _____________________________
> > So, to answer your question (umm, this may have been a bit of
> > overkill), yes, you can use employee_name[25] array. You would access
> > each "record" with a for loop. But there is no need to loop through
> > the name array unless you want to search the name for a particular
> > character.
> >
> > _____________________________
> > Marc Heiligers
> >
> >
> > -----Original Message-----
> > From: Rob Peacock [mailto:py...@ea...]
> > Sent: 22 October 2002 06:35 PM
> > To: dev...@li...
> > Subject: [Dev-C++] Question about structs...
> >
> >
> > OK, I'm back for more information. I'm looking at a slightly different
> > way of building the database I asked about yesterday.
> >
> > The examples I have seen for a structure are typically a database.
> > Here's the one I have seen posted on several newbie sites:
> >
> > #include <iostream.h>
> >
> > struct database
> > {
> > int id_number;
> > int age;
> > float salary;
> > };
> >
> > int main()
> > {
> > database employee;
> > employee.age=22;
> > employee.id_number=1;
> > employee.salary=120000.21;
> >
> > return 0;
> > }
> >
> > My question is this; this struct as it is written will only hold one
> > record, and all of the entries are int's. If I wanted to have multiple
> > records using the same struct, can I create a struct array (correct
> > terminology?) like this:
> >
> > struct database[100]
> > {
> > int id_number;
> > char employee_name[25];
> > int age;
> > float salary;
> > };
> >
> > To populate it, or to access the individual records within the array,
> > I would use the standard for() loops, correct? Same with the
> > emplyee_name[] array?
> >
> > Thanks all,
> >
> > --->Rob
> >
> >
> >
> >
> > -------------------------------------------------------
> > This sf.net emial is sponsored by: Influence the future
> > of Java(TM) technology. Join the Java Community
> > Process(SM) (JCP(SM)) program now.
> > http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0002en
> > _______________________________________________
> > Dev-cpp-users mailing list
> > Dev...@li...
> > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
> > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
> >
>
|
|
From: Dario C. <da...@ir...> - 2002-10-23 14:51:28
|
I am experiencing the problem with the DOS console (promt) window, when = the programme is executed the DOS console is automatically closed, I = tried changing the settings, etc, but the same thing happends, the DOS = output window is diseapearing, as I heard the same problem from people = using other compilers under Windows, I am wondering if anybody knows a = solution to this problem, thanks in advance, Dario |
|
From: Daniel G. <sp...@ho...> - 2002-10-23 14:21:16
|
Ah yes, because a static data member is essentially a global correct? _________________________________________________________________ Internet access plans that fit your lifestyle -- join MSN. http://resourcecenter.msn.com/access/plans/default.asp |
|
From: Osmany V. <ov...@ic...> - 2002-10-23 13:40:14
|
Hello, I have the version 1.614 of vupdate but i get the following error = message when i open it: Error: Your devcpp.cfg file is missing devcpp.cfg is in the root directory of Dev-C++. How can i fix this? Thanks all, Vargas |
|
From: Marc H. <ma...@e-...> - 2002-10-23 13:28:18
|
Hi Per W,
You're quite right about the GetXXX() methods. Early morning... Coding not
always best.
Ultimately , I would prefer to use a CString class for name and other string
type properties. Also use TCHAR instead of char, etc. etc. etc. CString
classes generally have a copy constructor so the result of GetName() would
not be able to change the value in the instance.
I did not know that about void. I knew it could be omitted in C++, but is it
convention to omit it?
As for the template container, I did say vector or similar. I guess it
depends on what features you need. Rob was talking about traversing the
"array" using for loops. I think a vector is quite handy for that. The point
was to get away from statically defined arrays.
_____________________________
Marc Heiligers
-----Original Message-----
From: Per Westermark [mailto:pw...@ia...]
Sent: 23 October 2002 02:55 PM
To: Marc Heiligers
Cc: 'Rob Peacock'; dev...@li...
Subject: RE: [Dev-C++] Question about structs...
What use is a Setname(char *szName) when the GetName() have already sent out
the pointer to the m_szName array? The GetName() method should be declared
const char* GetName() const; The First const to say that the returned
pointer may not be used to change the stored name. The second const to say
that the GetName() method doesn't change anything inside the class CEmployee
when called.
In fact, all GetXX() methods should be written as:
type GetXX() const;
Since this is C++, and not C, all methods not taking a parameter should be
written with empty parentheses. It is only in C, that the void keyword is
needed.
If using template containers, it might also be an idea to use the map
container instead, to allow direct sort and location of entries on customer
id.
/Per W
On Wed, 23 Oct 2002, Marc Heiligers wrote:
> Hi,
> If you build an array of structs as you have below, you have a fixed
> number of records. It might be a good idea to build your data
> structure (and I suggest using a class which you can then use to
> validate data and perform operations on your data) and then storing
> your "records" in a STL vector, or similar. This allows you to
> dymaically change the number of employee, etc. etc. etc. So you'd get
> something like:
>
> A file called "employee.h", for example _____________________________
> #include <vector>
>
> using namespace std;
>
> class CEmployee
> {
> public:
> CEmployee(); //constructor - init code
> ~CEmployee(); //destructor - clean up code
> public:
> BOOL SetId(int nId); //Get and set methods for props
> int GetId(void);
> BOOL SetAge(int nAge);
> int GetAge(void);
> BOOL SetSalary(float fSalary);
> float GetSalary(void);
> BOOL SetName(char *szName);
> char* GetName(void);
> private:
> //private properties
> int m_nId;
> int m_nAge;
> float m_fSalary;
> char m_szName[25];
> }
>
> typedef vector<CEmployee*> EMPLOYEES_DATABASE;
>
> _____________________________
> And then use
> _____________________________
> #include <iostream>
> #include "employee.h"
>
> int main(void)
> {
> EMPLOYEES_DATABASE database;
> CEmployee *employee = new CEmployee(); //Create new employee
> employee->SetName("Marc Heiligers"); //Set employee properties
> employee->SetAge(27);
> employee->SetId(0);
> employee->SetSalary(1000000.00);
> database.push_back(employee); //Add employee to
> end of vector
> .
> .
> .
> cout << "Number of employees: " << database.size() << endl;
>
> //Use an iterator to loop through all employees and print their
> names.
> EMPLOYEES_DATABASE::iterator iter;
> for (iter = database.begin(); iter != database.end; iter++)
> {
> employee = *iter;
> cout << "Name: " << employee->GetName() << endl;
> }
> return 0;
> }
> _____________________________
> So, to answer your question (umm, this may have been a bit of
> overkill), yes, you can use employee_name[25] array. You would access
> each "record" with a for loop. But there is no need to loop through
> the name array unless you want to search the name for a particular
> character.
>
> _____________________________
> Marc Heiligers
>
>
> -----Original Message-----
> From: Rob Peacock [mailto:py...@ea...]
> Sent: 22 October 2002 06:35 PM
> To: dev...@li...
> Subject: [Dev-C++] Question about structs...
>
>
> OK, I'm back for more information. I'm looking at a slightly different
> way of building the database I asked about yesterday.
>
> The examples I have seen for a structure are typically a database.
> Here's the one I have seen posted on several newbie sites:
>
> #include <iostream.h>
>
> struct database
> {
> int id_number;
> int age;
> float salary;
> };
>
> int main()
> {
> database employee;
> employee.age=22;
> employee.id_number=1;
> employee.salary=120000.21;
>
> return 0;
> }
>
> My question is this; this struct as it is written will only hold one
> record, and all of the entries are int's. If I wanted to have multiple
> records using the same struct, can I create a struct array (correct
> terminology?) like this:
>
> struct database[100]
> {
> int id_number;
> char employee_name[25];
> int age;
> float salary;
> };
>
> To populate it, or to access the individual records within the array,
> I would use the standard for() loops, correct? Same with the
> emplyee_name[] array?
>
> Thanks all,
>
> --->Rob
>
>
>
>
> -------------------------------------------------------
> This sf.net emial is sponsored by: Influence the future
> of Java(TM) technology. Join the Java Community
> Process(SM) (JCP(SM)) program now.
> http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0002en
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|
|
From: Per W. <pw...@ia...> - 2002-10-23 13:04:59
|
If you declare a method as static, you may call it before instancing
an object of the class type, i.e.
class MyClass {
public:
...
static void StaticMethod();
protected:
static int a_value;
};
int MyClass::a_value;
void MyClass::StaticMethod() {
a_value =3D rand();
}
int main() {
MyClass::StaticMethod();
MyClass obj;
return 0;
}
EMA System email: pw...@ia...
Per Westermark web: http://iapetus.neab.net
Vargvaegen 174B phone: +46 8 410 17 198
S-906 42 Umeaa
Sweden
On Wed, 23 Oct 2002, Daniel Glenfield wrote:
>=20
>=20
> When I create a class object, can I call a member function right away?
>=20
> I'm thinking that if I have private data I want to initialise when the=20
> object is created I could put in a member function that does it, but can =
I=20
> call it immediately? Instead of
>=20
> MyClass ObjectOne;
> ObjectOne.StartUp();
>=20
>=20
> I know that a constructor initialisation list will do the same, can someo=
ne=20
> show me an example of that as well as I am a little confused by the synta=
x.
>=20
> Daniel
>=20
>=20
>=20
> _________________________________________________________________
> Get a speedy connection with MSN Broadband.=A0 Join now!=20
> http://resourcecenter.msn.com/access/plans/freeactivation.asp
>=20
>=20
>=20
> -------------------------------------------------------
> This sf.net emial is sponsored by: Influence the future=20
> of Java(TM) technology. Join the Java Community=20
> Process(SM) (JCP(SM)) program now.=20
> http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0002en
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>=20
|
|
From: Abhijit S. <mu...@gm...> - 2002-10-23 13:00:55
|
Greets, Daniel.
> When I create a class object, can I call a member function right away?
>
> I'm thinking that if I have private data I want to initialise when the
> object is created I could put in a member function that does it, but can I
> call it immediately? Instead of
>
> MyClass ObjectOne;
> ObjectOne.StartUp();
>
>
> I know that a constructor initialisation list will do the same, can
someone
> show me an example of that as well as I am a little confused by the
syntax.
A constructor is basically a function that is called whenever an object of
the class is created. It's called in this case:
MyClass MyObject;
and also in this case:
pMyObject = new MyClass;
[-open-brace
But not here:
pMyObject = (MyClass *)malloc(sizeof(MyClass));
]-close-brace
The constructor should have the same name as the class, but no return type
(not void, it should have *no* return type), as in:
class MyClass
{
public:
MyClass(); // Constructor
~MyClass(); // Destructor
};
Constructors can take arguments, if necessary, like this:
MyClass(int some_foo);
You would invoke this constructor using
MyClass MyObject(666);
If you don't specify a constructor for a class, a default set of constructor
and destructor are provided for the class.
You don't have to explicitly call the constructor (in fact, you can't), it
is called whenever the object is created, and the destructor is called when
it goes out of scope. You can see the working if you write a test program
using cout within the constructor, something like this:
class foo
{
public:
foo()
{
cout << "The foo has risen.\n";
}
foo(int baz)
{
cout << "The foo has risen with " << baz
<< " coconuts.\n";
}
~foo()
{
cout << "The foo had you foolen. Now I will leave.\n";
}
}
and then creating objects using different means (static, dynamic).
___________________________________________________________
Abhijit Shylanath
E-mail: mu...@gm... || ibr...@bi...
Web-site: http://mudeth.tripod.com/
|
|
From: Per W. <pw...@ia...> - 2002-10-23 12:59:39
|
Actually not radio buttons bot check boxes but :-) One problem is that earlier versions of the update program doesn't seemed to work so well through firewalls. My copy always terminated when I tried to scan for updated packages. After getting a newer update program, it suddenly started to work ok. /Per W On Wed, 23 Oct 2002, Carlos Garc=EDa del Monte wrote: > Just, launch check for updated, click on start, then it connects to the s= erver > for check what updates are there, when it finishes it presents you a list= with > radiobuttons with the packages you can get, then select dev.hlp and downl= oad. >=20 > =3D?gb2312?q?=3DB3=3DC2=3DD1=3DD3=3DCE=3DC4?=3D escribi=F3: >=20 > > I launched Dev-C++ IDE. I open help menu and click > > help on dev-c++;But I was reminded "Can't find any > > c:\dev-cpp\devcpp.hlp". > > I launched check for update command, but connect > > update server. > > How can i get devcpp.hlp? > > Anyone email me a copy of devcpp.hlp?? > > > > _________________________________________________________ > > Do You Yahoo!? > > "=D4=B8=D2=E2=BB=A8=BC=B8=B7=D6=D6=D3=C0=B4=B8=C4=C9=C6=C4=FA=B5=C4=D1= =C5=BB=A2=B5=E7=D3=CA=B7=FE=CE=F1=C2=F0=A3=BF" > > http://sweepstakes.yahoo.com/email_usage > > > > ------------------------------------------------------- > > This sf.net emial is sponsored by: Influence the future > > of Java(TM) technology. Join the Java Community > > Process(SM) (JCP(SM)) program now. > > http://ad.doubleclick.net/clk;4699841;7576301;v?http://www.sun.com/java= vote > > _______________________________________________ > > Dev-cpp-users mailing list > > Dev...@li... > > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users >=20 >=20 >=20 > ------------------------------------------------------- > This sf.net emial is sponsored by: Influence the future > of Java(TM) technology. Join the Java Community > Process(SM) (JCP(SM)) program now. > http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0002en > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users >=20 |
|
From: Daniel G. <sp...@ho...> - 2002-10-23 12:56:23
|
Oh the site is now mindview.net, not .com from what I gether. Thanks, Daniel _________________________________________________________________ Surf the Web without missing calls! Get MSN Broadband. http://resourcecenter.msn.com/access/plans/freeactivation.asp |
|
From: Per W. <pw...@ia...> - 2002-10-23 12:55:14
|
What use is a Setname(char *szName) when the GetName() have already sent
out the pointer to the m_szName array? The GetName() method should be
declared
const char* GetName() const;
The First const to say that the returned pointer may not be used to change
the stored name. The second const to say that the GetName() method doesn't
change anything inside the class CEmployee when called.
In fact, all GetXX() methods should be written as:
type GetXX() const;
Since this is C++, and not C, all methods not taking a parameter should be
written with empty parentheses. It is only in C, that the void keyword is
needed.
If using template containers, it might also be an idea to use the map
container instead, to allow direct sort and location of entries on
customer id.
/Per W
On Wed, 23 Oct 2002, Marc Heiligers wrote:
> Hi,
> If you build an array of structs as you have below, you have a fixed number
> of records. It might be a good idea to build your data structure (and I
> suggest using a class which you can then use to validate data and perform
> operations on your data) and then storing your "records" in a STL vector, or
> similar. This allows you to dymaically change the number of employee, etc.
> etc. etc. So you'd get something like:
>
> A file called "employee.h", for example
> _____________________________
> #include <vector>
>
> using namespace std;
>
> class CEmployee
> {
> public:
> CEmployee(); //constructor - init code
> ~CEmployee(); //destructor - clean up code
> public:
> BOOL SetId(int nId); //Get and set methods for props
> int GetId(void);
> BOOL SetAge(int nAge);
> int GetAge(void);
> BOOL SetSalary(float fSalary);
> float GetSalary(void);
> BOOL SetName(char *szName);
> char* GetName(void);
> private:
> //private properties
> int m_nId;
> int m_nAge;
> float m_fSalary;
> char m_szName[25];
> }
>
> typedef vector<CEmployee*> EMPLOYEES_DATABASE;
>
> _____________________________
> And then use
> _____________________________
> #include <iostream>
> #include "employee.h"
>
> int main(void)
> {
> EMPLOYEES_DATABASE database;
> CEmployee *employee = new CEmployee(); //Create new employee
> employee->SetName("Marc Heiligers"); //Set employee properties
> employee->SetAge(27);
> employee->SetId(0);
> employee->SetSalary(1000000.00);
> database.push_back(employee); //Add employee to
> end of vector
> .
> .
> .
> cout << "Number of employees: " << database.size() << endl;
>
> //Use an iterator to loop through all employees and print their
> names.
> EMPLOYEES_DATABASE::iterator iter;
> for (iter = database.begin(); iter != database.end; iter++)
> {
> employee = *iter;
> cout << "Name: " << employee->GetName() << endl;
> }
> return 0;
> }
> _____________________________
> So, to answer your question (umm, this may have been a bit of overkill),
> yes, you can use employee_name[25] array. You would access each "record"
> with a for loop. But there is no need to loop through the name array unless
> you want to search the name for a particular character.
>
> _____________________________
> Marc Heiligers
>
>
> -----Original Message-----
> From: Rob Peacock [mailto:py...@ea...]
> Sent: 22 October 2002 06:35 PM
> To: dev...@li...
> Subject: [Dev-C++] Question about structs...
>
>
> OK, I'm back for more information. I'm looking at a slightly different way
> of building the database I asked about yesterday.
>
> The examples I have seen for a structure are typically a database. Here's
> the one I have seen posted on several newbie sites:
>
> #include <iostream.h>
>
> struct database
> {
> int id_number;
> int age;
> float salary;
> };
>
> int main()
> {
> database employee;
> employee.age=22;
> employee.id_number=1;
> employee.salary=120000.21;
>
> return 0;
> }
>
> My question is this; this struct as it is written will only hold one record,
> and all of the entries are int's. If I wanted to have multiple records using
> the same struct, can I create a struct array (correct
> terminology?) like this:
>
> struct database[100]
> {
> int id_number;
> char employee_name[25];
> int age;
> float salary;
> };
>
> To populate it, or to access the individual records within the array, I
> would use the standard for() loops, correct? Same with the emplyee_name[]
> array?
>
> Thanks all,
>
> --->Rob
>
>
>
>
> -------------------------------------------------------
> This sf.net emial is sponsored by: Influence the future
> of Java(TM) technology. Join the Java Community
> Process(SM) (JCP(SM)) program now.
> http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0002en
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|
|
From: Magnus M. <mag...@ep...> - 2002-10-23 12:43:16
|
Daniel Glenfield wrote:
> This seems interesting, I'm working with Access at the moment. where
> ar ethese instructions on the web?
One of the "conversions" I tried is at
http://www.mingw.org/mingwfaq.shtml#faq-msvcdll
A loosely related page is
http://www.mysql.com/doc/en/Windows_client_compiling.html
Someone is having the same problem as I at
http://dbforums.com/archive/156/2002/03/3/322977
The file I am looking for once existed at
http://www.johnydog.cz/projects.php
but the server is not available anymore :-(
Magnus
|
|
From: Per W. <pw...@ia...> - 2002-10-23 12:40:51
|
If it's just for your use, you might try to install cygwin on your machine. This is a unix emulation layer for windows, and will allow you to compile and run most unix software directly under windows - inclusive X11 applications. If your goal on the other hand is to compile an application for general distribution to windows machines, then you have to do a full port of the source. Depending on what features the code is using, this might be interesting times :-) /Per W On Tue, 22 Oct 2002, "J=F6rgen" wrote: > Hi Mac=E1rio >=20 > I think those headerfiles are needed when running in Unix (Linux as well = I suppose). > What you need to do to make it work under Win is to include <windows.h> a= nd some other stuff. > Take a look at this tutorial. >=20 > http://www.ecst.csuchico.edu/~beej/guide/net/bgnet.pdf >=20 > I strongly recommend that you read through the tutorial. It's long, but i= t's worth reading. Very informative! >=20 > Regards > /J=F6rgen >=20 > *********** REPLY SEPARATOR *********** >=20 > On 2002-10-22 at 17:12 Andr=E9 Mac=E1rio Barros wrote: >=20 > >Gentelmen, > > I need your help... let me retransmit my question: > >=3D=3D=3D > >I need to run the client-server Douglas Comer example, but I didn't find > > > >the following include files in DevC++: > > > > socket.h > > in.h > > netdb.h > > pwd.h > > > >Where can I find them? For Win'9x and Linux? > > > >Best Regards > >Mac=E1rio > > > > > > > > > > > >------------------------------------------------------- > >This sf.net emial is sponsored by: Influence the future > >of Java(TM) technology. Join the Java Community > >Process(SM) (JCP(SM)) program now. > >http://ad.doubleclick.net/clk;4699841;7576301;v?http://www.sun.com/javav= ote > >_______________________________________________ > >Dev-cpp-users mailing list > >Dev...@li... > >TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users >=20 > =FF >=20 >=20 >=20 > ------------------------------------------------------- > This sf.net emial is sponsored by: Influence the future > of Java(TM) technology. Join the Java Community > Process(SM) (JCP(SM)) program now. > http://ad.doubleclick.net/clk;4699841;7576301;v?http://www.sun.com/javavo= te > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users >=20 |
|
From: Teodorescu C. <te...@xt...> - 2002-10-23 12:37:22
|
Daniel Glenfield wrote:
>
>> From: Teodorescu Cristian <te...@xt...>
>> To: dev...@li...
>> Subject: Re: [Dev-C++] Question about class objects
>> Date: Wed, 23 Oct 2002 15:00:56 +0200
>>
>> Daniel Glenfield wrote:
>>
>>>
>>>
>>> When I create a class object, can I call a member function right away?
>>>
>>> I'm thinking that if I have private data I want to initialise when
>>> the object is created I could put in a member function that does it,
>>> but can I call it immediately? Instead of
>>>
>>> MyClass ObjectOne;
>>> ObjectOne.StartUp();
>>>
>>>
>>> I know that a constructor initialisation list will do the same, can
>>> someone show me an example of that as well as I am a little confused
>>> by the syntax.
>>
>>
>> class MyClass{
>> public :
>> MyClass (int x=0){
>> m_intX=x;
>> }
>> private:
>> m_intX;
>> }
>>
>> void main (void ){
>> MyClass a,b(10);
>> //a.m_intX=0 and in b.m_intX=0;
>> }
>> for more info read Bruce Eckel thinking in c++ (http://www.mindview.com)
>> it's free.
>>
>>>
>>> Daniel
>>>
>>>
>>>
>
>
> Are you sure
>
>> class MyClass{
>> public :
>> MyClass (int x=0){
>> m_intX=x;
>> }
>> private:
>> m_intX;
>> }
>>
>> void main (void ){
>> MyClass a,b(10);
>> //a.m_intX=0 and in b.m_intX=0;
>> }
>
>
> is valid? MyClass (int x=0) is that valid
Have you ever heard about default parameters ?
> ? And when you pass 10 to the constructor, is it not expecting a
> variable of type int, not an integer?
it's OK code work except on bug * *int m_intX**
>
>
> _________________________________________________________________
> Unlimited Internet access -- and 2 months free! Try MSN.
> http://resourcecenter.msn.com/access/plans/2monthsfree.asp
>
>
>
> -------------------------------------------------------
> This sf.net emial is sponsored by: Influence the future of Java(TM)
> technology. Join the Java Community Process(SM) (JCP(SM)) program now.
> http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0002en
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
--
Best Reagards Teodorescu Cristian Liviu (te...@xt...)
|
|
From: Daniel G. <sp...@ho...> - 2002-10-23 12:09:06
|
>From: Teodorescu Cristian <te...@xt...>
>To: dev...@li...
>Subject: Re: [Dev-C++] Question about class objects
>Date: Wed, 23 Oct 2002 15:00:56 +0200
>
>Daniel Glenfield wrote:
>
>>
>>
>>When I create a class object, can I call a member function right away?
>>
>>I'm thinking that if I have private data I want to initialise when the
>>object is created I could put in a member function that does it, but can I
>>call it immediately? Instead of
>>
>>MyClass ObjectOne;
>>ObjectOne.StartUp();
>>
>>
>>I know that a constructor initialisation list will do the same, can
>>someone show me an example of that as well as I am a little confused by
>>the syntax.
>
>class MyClass{
>public :
> MyClass (int x=0){
> m_intX=x;
> }
>private:
> m_intX;
>}
>
>void main (void ){
> MyClass a,b(10);
> //a.m_intX=0 and in b.m_intX=0;
>}
>for more info read Bruce Eckel thinking in c++ (http://www.mindview.com)
>it's free.
>
>>
>>Daniel
>>
>>
>>
Are you sure
>class MyClass{
>public :
> MyClass (int x=0){
> m_intX=x;
> }
>private:
> m_intX;
>}
>
>void main (void ){
> MyClass a,b(10);
> //a.m_intX=0 and in b.m_intX=0;
>}
is valid? MyClass (int x=0) is that valid? And when you pass 10 to the
constructor, is it not expecting a variable of type int, not an integer?
_________________________________________________________________
Unlimited Internet access -- and 2 months free! Try MSN.
http://resourcecenter.msn.com/access/plans/2monthsfree.asp
|
|
From: Teodorescu C. <te...@xt...> - 2002-10-23 12:01:05
|
Daniel Glenfield wrote:
>
>
> When I create a class object, can I call a member function right away?
>
> I'm thinking that if I have private data I want to initialise when the
> object is created I could put in a member function that does it, but
> can I call it immediately? Instead of
>
> MyClass ObjectOne;
> ObjectOne.StartUp();
>
>
> I know that a constructor initialisation list will do the same, can
> someone show me an example of that as well as I am a little confused
> by the syntax.
class MyClass{
public :
MyClass (int x=0){
m_intX=x;
}
private:
m_intX;
}
void main (void ){
MyClass a,b(10);
//a.m_intX=0 and in b.m_intX=0;
}
for more info read Bruce Eckel thinking in c++ (http://www.mindview.com)
it's free.
>
> Daniel
>
>
>
> _________________________________________________________________
> Get a speedy connection with MSN Broadband. Join now!
> http://resourcecenter.msn.com/access/plans/freeactivation.asp
>
>
>
> -------------------------------------------------------
> This sf.net emial is sponsored by: Influence the future of Java(TM)
> technology. Join the Java Community Process(SM) (JCP(SM)) program now.
> http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0002en
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
--
Best Reagards Teodorescu Cristian Liviu (te...@xt...)
|
|
From: Abhijit S. <mu...@gm...> - 2002-10-23 11:46:58
|
> struct database[100]
No, just
struct database
> {
> int id_number;
> char employee_name[25];
> int age;
> float salary;
> };
>
> To populate it, or to access the individual records within the array, I
> would use the standard for() loops, correct? Same with the emplyee_name[]
> array?
and when you're declaring the variable,
database employees[100];
employee[0].age = 666;
Or, you could use vectors, like Marc said. That would translate to
vector<database> employees;
That would be valid only in C++, not in C. I assume you're working with C.
You could use dynamic memory allocation for variable sized arrays. The
functions that you would use are malloc(), realloc(), free().
Also, you ask about using a variable to index employee_name. I hope you're
not getting confused about NULL-terminated character arrays (strings).
char name[20];
is a character array. You can use it to store arrays of characters, and if
this array is ended by a NULL-character ('\0'), it becomes a string. So in
the above example, to print the name of the first employee, you would say
printf("%s\n", employee[0].employee_name);
*NOT*
printf("%s\n", employee[0].employee_name[0]);
I hope I helped and didn't just confuse you further.
___________________________________________________________
Abhijit Shylanath
E-mail: mu...@gm... || ibr...@bi...
Web-site: http://mudeth.tripod.com/
|
|
From: Daniel G. <sp...@ho...> - 2002-10-23 11:33:14
|
When I create a class object, can I call a member function right away? I'm thinking that if I have private data I want to initialise when the object is created I could put in a member function that does it, but can I call it immediately? Instead of MyClass ObjectOne; ObjectOne.StartUp(); I know that a constructor initialisation list will do the same, can someone show me an example of that as well as I am a little confused by the syntax. Daniel _________________________________________________________________ Get a speedy connection with MSN Broadband. Join now! http://resourcecenter.msn.com/access/plans/freeactivation.asp |
|
From: Frank W. <F.W...@wi...> - 2002-10-23 11:16:36
|
Hello, I'm working on NT4SP6 and run vUpdate. After updating a new start of vUpdate leads to an Error that said: Error: devcpp.cfg not found Please check ... I checked these folders and I copied devcpp to all that directories I thought they could take affect. Devcpp.cfg is in the root directory of Dev-C++ and at serveral locations in C:\WinNt\profiles...\Application Data. But the Error is still present even if I restart Dev-C++. How can this be fixed? Greetings Frank |