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
(11) |
2
(8) |
3
(7) |
4
(24) |
5
(11) |
6
(5) |
7
(5) |
8
(14) |
9
(20) |
10
(16) |
11
(11) |
12
(9) |
13
(14) |
14
(15) |
15
(19) |
16
(25) |
17
(13) |
18
(6) |
19
(17) |
20
(10) |
21
(14) |
22
(23) |
23
(10) |
24
|
25
|
26
(6) |
27
(32) |
28
(15) |
29
(7) |
30
(13) |
31
(36) |
From: <de...@ci...> - 2004-01-31 21:59:02
|
In the first form you have two different types, and you can use either. For instance struct _Human fred; Human joe; Note that it is simply to avoid always having to refer to struct _Human that the typedef is used. This is traditional C usage. In C++ on the other hand the second form is used, and the type is Human, not struct Human. So you can use Human joe; C++ compilers will compile the first form too, but the resulting types will be _Human and Human unless there is an extern "C" block surrounding the declaration. In article <BAY...@ho...>, coo...@ho... (Noorez Kassam) wrote: > what is the difference between these two > > typedef struct _Human > { > int height; > }Human; > > struct Human > { > int height; > }; > > > and in the first one, what does 'Human' mean at the end? In both > structs u can declare a Human type, even without the Human thing at the > end in the first one |
From: Scott S. <age...@co...> - 2004-01-31 21:24:24
|
The .dll is only for linking dynamically, where you use a .dll and it is distributed with your file versus being put in the .exe. Make sure you have all of the required .a files linked, and none of your headers are in the bin list. Or, try pulling the bin thing from the list of headers and libs and see what happens. If you can get access to another compiler, try using it. I am not sure if you have tried reinstalling Dev-C++ yet. Have you? Also, try upgrading to the latest version of Dev-C++. Daniel Watson wrote: >Thanks for the suggestion Scott. It's pointing to the proper bin in >Dev-C++ in the compiler options. > >I tried going through the compiler options and found nothing but the >default listed and the G++ directory within the include file. But, I did >notice that I had set Dev-C++ to create a Project for C++ so it made a >resource file with that in it to link the icon. I took it out and still >got the same message. > >So I decided to try another example from scratch. The hello C. Upon >creating a project I chose the OpenGL for the project, linked the glut >file, but I am still getting the same message... > >gcc: Compilation of header file requested >gcc: file path prefix `C:\DEV-C_~1\Bin\' never used > > >This is the hello.c example at this link... > >http://www.opengl.org/resources/code/basics/redbook/index.html > > >Is there a newer version of the glut that I should be using? I went to >the Nate Robins site and downloaded the (everything you need to get >started with glut) link. Do I need to use the glut32.dll as well? >Should it be in the G++ file within the Include directory? > >Any other ideas would be greatly appreciated, >DWW > > >-----Original Message----- >From: Scott Simontis [mailto:age...@co...] >Sent: Friday, January 30, 2004 3:30 PM >To: Daniel Watson >Subject: Re: [Dev-C++] OpenGL with Glut blues... > >There is no order they need to be in. However, I think it helps to sort >them out. I list custom headers first, then library headers, then C++ >headers, and finnaly C headers. It looks like it is saying that one of >the headers has C:\DEV-C_~1\Bin\ in it. All of the headers aren't there. > >Go to Tools -> Compiler Options. Then, click on the Directories tab. >Next, click on the Libraries, C Headers, and C++ Headers sub tabs and >make sure C:\Dev-C_~1\Bin or anything like that is in one of those >fields. >Daniel Watson wrote: > > > >>I am trying to compile a basic example from the openGL site, >>alpha3d.c. >>(http://www.opengl.org/resources/code/basics/redbook/index.html) >> >>At first I was getting a number of undefined references. >> >>After going through a number of postings on bloodshed for including >>links, then not including some links but try this link, I am down to >>two linker errors... >> >>g++: Compilation of header file requested >>g++: file path prefix `C:\DEV-C_~1\Bin\' never used >>Here are the two files I have linked in... >>C:\Dev-C++\Include\Gl\glut.h >>C:\Dev-C++\Lib\glut32.lib >> >>I have also set the comppiler option to support All ANSI C. >> >>And here are the include lines at the opening of the script... >> >>#include <Gl/glut.h> >>#include <stdlib.h> >>#include <stdio.h> >> >>Is there a certain order the includes should be in? >>I am using glut 3.7.6 >> >>Thanks in advance, >>DWW >> >> >> > > > > >------------------------------------------------------- >The SF.Net email is sponsored by EclipseCon 2004 >Premiere Conference on Open Tools Development and Integration >See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. >http://www.eclipsecon.org/osdn >_______________________________________________ >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: Scott S. <age...@co...> - 2004-01-31 20:42:44
|
Just write a .cpp file with all the functions your library will use, and use the command line tools to convert it into a .a file. Then, make a .h file with function and variable declerations, and you are set. invognito incognito wrote: > > > Hi I am AFROMEISTER and this is my first ever post to the list, > > I have been wondering for some time and searched through the forums, > but as I am a C++ newbie I have been unable to find any information > that I can use about making a library using Dev-C++. My e-mail adress > is MVC...@ho... <mailto:MVC...@ho...> and any > information or URL's relating to making a library using Dev-C++ would > be gratefully reveived. > sincerely thankfull, > > AFROMEISTER > > > ------------------------------------------------------------------------ > Hot chart ringtones and polyphonics. Click here. > <http://g.msn.com/8HMBENAU/2737??PS=> > ------------------------------------------------------- The SF.Net > email is sponsored by EclipseCon 2004 Premiere Conference on Open > Tools Development and Integration See the breadth of Eclipse activity. > February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn > _______________________________________________ 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: Scott S. <age...@co...> - 2004-01-31 20:41:02
|
Lets just leave this topic in the dust. This could become a flame war at any second, and I don't want this to offend anymore people. If we aren't going to stop this, at least only e-mail it to those who want to hear it. Maya wrote: > OK? > > ku...@sp... wrote: > >>Well said Maya!! :-) >> >>NOW WE FIND THERE IS NO FUSTRATION IN C++ WHEN , ONE APPLY THE RULES OF >>C++ , IN THE REALM OF MACHINES, THAT IS SOFTWARES THAT RUNS THEM. >> >>Rudolph ;-)) >> >> >> >>----- Original Message ----- >>From: "Maya" <Esc...@ne...> >>To: "Dev-C++ Mailing List" <dev...@li...> >>Sent: Friday, January 30, 2004 12:08 AM >>Subject: Re: [Dev-C++] fustrations in c++ >> >> >> >> >>>Religion has not value in the science realm. Religion is based on faith, >>>and the absolute value of it is the corner stone of any religion. >>>Science on the other hand makes no attempt to apply faith to any of its >>>certainties, or lack of it for that matter. >>>Please leave it at that, don't pursue this issue any longer. I realize >>>this topic is important to you, but it is taking space in a mail group >>>that does not deal with that area of life. I would *very* strongly >>>suggest that you move this line of emails to either a personal [email to >>>email] level or to alt.religion.... news group. >>>In other words, knock it off kids! >>>Have a good one, and if you are going to have more than one.... give me >>>shout, eh! >>> >>> >>> >>> >>> >> >> >> >> > >-- > >FYI >http://www.astro.umd.edu/~marshall/abbrev.html > >E-Mail Policy >http://www.vif.com/users/escalante/Email_Policy.html > >* You cannot exercise your power to a point of humiliation. > - Jean Chretien > >* The media's the most powerful entity on earth. They have the > power to make the innocent guilty and to make the guilty > innocent, and that's power. > - Malcom X >* "Innocent until proven guilty", no... not in Canada!! > > |
From: Oleksandr Y. <erm...@ma...> - 2004-01-31 20:02:16
|
Hello Miguel, Friday, January 30, 2004, 3:22:05 AM, you wrote: > Hmmm. I am a bit puzzled. Could you tell which one is this OO library? > Who must derive from/delegate on CGObject? Or it is a Policy class, that > becomes the template parameter of some other class? This library is GTL. http://www.gtl.kis.ru/bin/GTL10R8.exe This class with "delete this" is the template parameter of pointers "container" class. (see line #33 /Source/Gobject.cpp) This library is based on MFC :-( Therefore i have no plans to use it in real work, but some design concepts of this library are interesting(and may be some of them are dangerous :-) ). > [...], but valgrind > used from commandline would be a nice asset to add to Win32 debugging > tools. Yes, it will be useful tool. Among similar tools under Win32 i have used only CodeGuard (comes with Borland C++ Builder 5 or later(may be)). Valgrind under Win32 can be a good open source replacement. -- Best regards, Oleksandr mailto:erm...@ma... |
From: Oleksandr Y. <erm...@ma...> - 2004-01-31 19:51:38
|
Obi <ob...@ch...> wrote: > Also you need to be sure the instance is actually new-ed. If the instance > is an automatic or static variable callinf "delete this" will have undefined > behaviour, probably bad. > If you want to "delete this" you are recommended to have private > constructors and destructor. Use a factory method to create objects. Good idea. Thank you. Private constructor/destructors (friend'ed only for container of ptrs) will prevent incorrect using of this class. -- Best regards, Oleksandr mailto:erm...@ma... |
From: Ed C. <em...@ed...> - 2004-01-31 19:16:55
|
Hi, The former declares a datatype named Human; the latter declares a structure tag Human. To declare a Human named Joe, in the first case you would simply type: Human Joe; In the latter, it would be: struct Human Joe; See also http://www.eskimo.com/~scs/C-faq/q2.1.html -Ed |
From: Maya <Esc...@ne...> - 2004-01-31 19:15:15
|
OK? ku...@sp... wrote: >Well said Maya!! :-) > >NOW WE FIND THERE IS NO FUSTRATION IN C++ WHEN , ONE APPLY THE RULES OF >C++ , IN THE REALM OF MACHINES, THAT IS SOFTWARES THAT RUNS THEM. > >Rudolph ;-)) > > > >----- Original Message ----- >From: "Maya" <Esc...@ne...> >To: "Dev-C++ Mailing List" <dev...@li...> >Sent: Friday, January 30, 2004 12:08 AM >Subject: Re: [Dev-C++] fustrations in c++ > > > > >>Religion has not value in the science realm. Religion is based on faith, >>and the absolute value of it is the corner stone of any religion. >>Science on the other hand makes no attempt to apply faith to any of its >>certainties, or lack of it for that matter. >>Please leave it at that, don't pursue this issue any longer. I realize >>this topic is important to you, but it is taking space in a mail group >>that does not deal with that area of life. I would *very* strongly >>suggest that you move this line of emails to either a personal [email to >>email] level or to alt.religion.... news group. >>In other words, knock it off kids! >>Have a good one, and if you are going to have more than one.... give me >>shout, eh! >> >> >> >> >> > > > > -- FYI http://www.astro.umd.edu/~marshall/abbrev.html E-Mail Policy http://www.vif.com/users/escalante/Email_Policy.html * You cannot exercise your power to a point of humiliation. - Jean Chretien * The media's the most powerful entity on earth. They have the power to make the innocent guilty and to make the guilty innocent, and that's power. - Malcom X * "Innocent until proven guilty", no... not in Canada!! |
From: Michael C U. <mu...@cb...> - 2004-01-31 18:02:00
|
On Sat, 31 Jan 2004, Per Westermark wrote: > No, you are confusing the declaration of a pointer variable with the use > of one. Oops. Yeah. I read it too quickly and missed that it was an assignment. I also missed that he had a second x in there. |
From: Per W. <pw...@ia...> - 2004-01-31 17:54:17
|
Hmmm. I assume your example was ment to be: int x,y; int *p = &x; /* Don't forget the address operator here... */ p += 1; /Per W On Sat, 31 Jan 2004, Michael C Urban wrote: > On Sat, 31 Jan 2004, Brian Gordon wrote: > > > I'm new to C++ and in my C++ book, I am learning about pointers. I have > > a question: can you store an address to some kind of "omnitype" pointer? > > I am thinking about doing something like this: > > Although in my last message I showed you how to do what you are asking, I > would also stress that directly manipulating pointer addresses is usually > quite risky unless you are doing some kind of very low level programming > (like programming a microcontroller). Pointer address manipulation is only > guranteed to behave well if you are dealing with an array, where you know > the the elements of the array are stored contigiously in memory. The > following code sample is a disaster waiting to happen: > > int x, y; > int *p = x; > p += 1; > > In this case, I have increased the address of *p by one integer offset. In > other words, I have increased the address that *p points to by 32 bits. So > *p no longer points at x. But does it point at y? Probably not, because > there is no gurantee that x and y are stroed contigiously in memory, even > though they were declared one right after the other. So in the above > sample, we cannot predict what the results will be since *p now points to > an address with unpredictable contents. (More then likely, *p now points > to garbage). > > Hope that clears things up, and hope I wasn't just telling you stuff you > already know. But you said you were new to C++, and it looked like what > you were doing was probably unsafe. > > Mike > > > ------------------------------------------------------- > The SF.Net email is sponsored by EclipseCon 2004 > Premiere Conference on Open Tools Development and Integration > See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. > http://www.eclipsecon.org/osdn > _______________________________________________ > 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: Michael C U. <mu...@cb...> - 2004-01-31 17:52:44
|
On Sat, 31 Jan 2004, Michael C Urban wrote: > int x, y; > int *p = x; > p += 1; Oops. Of course, that should have been: int x, y; int *p = &x; p += 1; Mike |
From: Per W. <pw...@ia...> - 2004-01-31 17:52:02
|
No, you are confusing the declaration of a pointer variable with the use of one. int *point = 0x241xff5f; does not change what *point contains. It is just an assignment with wrong type, i.e the hexadecimal constant is not of type 'pointer to int'. int *point = (*int)0x241xff5f; would work better - except for the fact that the hexadecimal constant is broken - where does the second x come from? The problem with this construct is that since you don't know what the address 0x241... points to, you don't know if the program has the right to read the address. If it hasn't, the program will be terminated! /Per W On Sat, 31 Jan 2004, Michael C Urban wrote: > Brian, > > > int *point = 0x241xff5f; > > cout << *point; > > This doesn't work because it changes the value that *point contains. > Remembet that * is the dereference operator. It access the value rather > than the address. > > To access the pointer itself, you don't want anything before it. So here > is an example to do what you want: > > int *point; /* declare a pointer */ > point = 0x241xff5f; /* change the address that it points to */ > cout < *point; /* derefernce the poiner and print its value */ > > Notice that i don't use any operator when assigning the value to point. > That's because I want to change the actual address that point is point at, > rather than change the value that the current address of point contains. > > Of course, the above example is only useful if you know that the address > contains an int value. Also, if you try to access a memory address that > doesn't belong to your program, Windows might catch you and kill your > program. So make sure you know that the address you assign to point is > actually "owned" by your program. > > Hope this helps, > > Mike > > > ------------------------------------------------------- > The SF.Net email is sponsored by EclipseCon 2004 > Premiere Conference on Open Tools Development and Integration > See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. > http://www.eclipsecon.org/osdn > _______________________________________________ > 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: Michael C U. <mu...@cb...> - 2004-01-31 17:48:16
|
On Sat, 31 Jan 2004, Brian Gordon wrote: > I'm new to C++ and in my C++ book, I am learning about pointers. I have > a question: can you store an address to some kind of "omnitype" pointer? > I am thinking about doing something like this: Although in my last message I showed you how to do what you are asking, I would also stress that directly manipulating pointer addresses is usually quite risky unless you are doing some kind of very low level programming (like programming a microcontroller). Pointer address manipulation is only guranteed to behave well if you are dealing with an array, where you know the the elements of the array are stored contigiously in memory. The following code sample is a disaster waiting to happen: int x, y; int *p = x; p += 1; In this case, I have increased the address of *p by one integer offset. In other words, I have increased the address that *p points to by 32 bits. So *p no longer points at x. But does it point at y? Probably not, because there is no gurantee that x and y are stroed contigiously in memory, even though they were declared one right after the other. So in the above sample, we cannot predict what the results will be since *p now points to an address with unpredictable contents. (More then likely, *p now points to garbage). Hope that clears things up, and hope I wasn't just telling you stuff you already know. But you said you were new to C++, and it looked like what you were doing was probably unsafe. Mike |
From: RUDOLPH <ku...@sp...> - 2004-01-31 17:14:15
|
Well said Maya!! :-) NOW WE FIND THERE IS NO FUSTRATION IN C++ WHEN , ONE APPLY THE RULES OF C++ , IN THE REALM OF MACHINES, THAT IS SOFTWARES THAT RUNS THEM. Rudolph ;-)) ----- Original Message ----- From: "Maya" <Esc...@ne...> To: "Dev-C++ Mailing List" <dev...@li...> Sent: Friday, January 30, 2004 12:08 AM Subject: Re: [Dev-C++] fustrations in c++ > Religion has not value in the science realm. Religion is based on faith, > and the absolute value of it is the corner stone of any religion. > Science on the other hand makes no attempt to apply faith to any of its > certainties, or lack of it for that matter. > Please leave it at that, don't pursue this issue any longer. I realize > this topic is important to you, but it is taking space in a mail group > that does not deal with that area of life. I would *very* strongly > suggest that you move this line of emails to either a personal [email to > email] level or to alt.religion.... news group. > In other words, knock it off kids! > Have a good one, and if you are going to have more than one.... give me > shout, eh! > > > |
From: Michael C U. <mu...@cb...> - 2004-01-31 15:59:04
|
Brian, > int *point = 0x241xff5f; > cout << *point; This doesn't work because it changes the value that *point contains. Remembet that * is the dereference operator. It access the value rather than the address. To access the pointer itself, you don't want anything before it. So here is an example to do what you want: int *point; /* declare a pointer */ point = 0x241xff5f; /* change the address that it points to */ cout < *point; /* derefernce the poiner and print its value */ Notice that i don't use any operator when assigning the value to point. That's because I want to change the actual address that point is point at, rather than change the value that the current address of point contains. Of course, the above example is only useful if you know that the address contains an int value. Also, if you try to access a memory address that doesn't belong to your program, Windows might catch you and kill your program. So make sure you know that the address you assign to point is actually "owned" by your program. Hope this helps, Mike |
From: Brian G. <mic...@ad...> - 2004-01-31 15:19:59
|
I'm new to C++ and in my C++ book, I am learning about pointers. I have a question: can you store an address to some kind of "omnitype" pointer? I am thinking about doing something like this: int *point = 0x241xff5f; cout << *point; so I can see what is in block 0x241xff5f. However, Dev_C++ won't allow me to compile this, and I think I know why: 0x241xff5f isn't neccessarily an int. Is there any way to do something like: readMem("0x241xff5f"); and it would return the ONE BYTE that is located at 0x241xff5f? Would the first block of code work if I put an "&" in front of the address? |
From: Per W. <pw...@ia...> - 2004-01-31 13:18:02
|
Maya - try compiling your examples :-) This is a construct that is affected by language. In C: struct Human { ... }; Require you to always declare your variables as: struct Human a_human; In C++ - together with the addition of the class keyword - you can get away with: struct Human { ... }; Human a_human; or class Human { public: ... }; Human a_human; So basically: typedef struct Human { ... } _Human; declares a structure named Human, and typedef this struct to the name _Human. In C, you can then declare a variable as either of: struct Human a_human; /* referencing the name of the struct */ _Human a_human; /* referencing type typedef name */ while in C++ it doesn't matter. It is even possible to define the data type as: typedef struct Human { .. } Human; i.e. same name for the struct declaration and for type typedef. /Per W On Sat, 31 Jan 2004, Maya wrote: > In the first one you have declared a struct named _Human and > instantiated it right after the declaration with name Human. In your > program you can just say for instance: " Human.height = 1.70 " and it > will work > Here is another example: > typedef struct _Human { > int height; > }Human; > > int main(){ > std::cout << "The Human Project" << std::endl; > std::cout << "How tall are you " ; > std::cin >> Human.height; > return 0; > } > > In the second example you have declared a struct named Human, but has > not yet been instantiated. > Your code would look something like this > > struct Human { > int height; > }; > int main(){ > Human human; // Instantiating the Human struct > std::cout << "The Human Project" << std::endl; > std::cout << "How tall are you " ; > std::cin >> human.height; // <<== > return 0; > } > Which one is better? it depends on the program you are working on, really! > > Hava a good one! > coo...@ho... wrote: > > > what is the difference between these two > > > > typedef struct _Human > > { > > int height; > > }Human; > > > > struct Human > > { > > int height; > > }; > > > > > > and in the first one, what does 'Human' mean at the end? In both > > structs u can declare a Human type, even without the Human thing at > > the end in the first one > > > > _________________________________________________________________ > > STOP MORE SPAM with the new MSN 8 and get 2 months FREE* > > http://join.msn.com/?page=dept/bcomm&pgmarket=en-ca&RU=https%3a%2f%2ffanyv88.com%3a443%2fhttp%2fjoin.msn.com%2f%3fpage%3dmisc%2fspecialoffers%26pgmarket%3den-ca > > > > > > > > > > ------------------------------------------------------- > > The SF.Net email is sponsored by EclipseCon 2004 > > Premiere Conference on Open Tools Development and Integration > > See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. > > http://www.eclipsecon.org/osdn > > _______________________________________________ > > 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 > > > -- > > FYI > http://www.astro.umd.edu/~marshall/abbrev.html > > E-Mail Policy > http://www.vif.com/users/escalante/Email_Policy.html > > * You cannot exercise your power to a point of humiliation. > - Jean Chretien > > * The media's the most powerful entity on earth. They have the > power to make the innocent guilty and to make the guilty > innocent, and that's power. > - Malcom X > * "Innocent until proven guilty", no... not in Canada!! > > > > > ------------------------------------------------------- > The SF.Net email is sponsored by EclipseCon 2004 > Premiere Conference on Open Tools Development and Integration > See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. > http://www.eclipsecon.org/osdn > _______________________________________________ > 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: <or...@vp...> - 2004-01-31 12:30:19
|
Maya wrote: > In the first one you have declared a struct named _Human and=20 > instantiated it right after the declaration with name Human. In your=20 > program you can just say for instance: " Human.height =3D 1.70 " and it= =20 > will work > Here is another example: > typedef struct _Human { > int height; > }Human; >=20 > int main(){ > std::cout << "The Human Project" << std::endl; > std::cout << "How tall are you " ; > std::cin >> Human.height; > return 0; > } No, it is not true. In fact this doesn't even work. -- Greetings, Bal=C3=A1zs |
From: Maya <Esc...@ne...> - 2004-01-31 12:14:33
|
In the first one you have declared a struct named _Human and instantiated it right after the declaration with name Human. In your program you can just say for instance: " Human.height = 1.70 " and it will work Here is another example: typedef struct _Human { int height; }Human; int main(){ std::cout << "The Human Project" << std::endl; std::cout << "How tall are you " ; std::cin >> Human.height; return 0; } In the second example you have declared a struct named Human, but has not yet been instantiated. Your code would look something like this struct Human { int height; }; int main(){ Human human; // Instantiating the Human struct std::cout << "The Human Project" << std::endl; std::cout << "How tall are you " ; std::cin >> human.height; // <<== return 0; } Which one is better? it depends on the program you are working on, really! Hava a good one! coo...@ho... wrote: > what is the difference between these two > > typedef struct _Human > { > int height; > }Human; > > struct Human > { > int height; > }; > > > and in the first one, what does 'Human' mean at the end? In both > structs u can declare a Human type, even without the Human thing at > the end in the first one > > _________________________________________________________________ > STOP MORE SPAM with the new MSN 8 and get 2 months FREE* > http://join.msn.com/?page=dept/bcomm&pgmarket=en-ca&RU=https%3a%2f%2ffanyv88.com%3a443%2fhttp%2fjoin.msn.com%2f%3fpage%3dmisc%2fspecialoffers%26pgmarket%3den-ca > > > > > ------------------------------------------------------- > The SF.Net email is sponsored by EclipseCon 2004 > Premiere Conference on Open Tools Development and Integration > See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. > http://www.eclipsecon.org/osdn > _______________________________________________ > 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 -- FYI http://www.astro.umd.edu/~marshall/abbrev.html E-Mail Policy http://www.vif.com/users/escalante/Email_Policy.html * You cannot exercise your power to a point of humiliation. - Jean Chretien * The media's the most powerful entity on earth. They have the power to make the innocent guilty and to make the guilty innocent, and that's power. - Malcom X * "Innocent until proven guilty", no... not in Canada!! |
From: Jack C. <jac...@ya...> - 2004-01-31 08:14:55
|
--- Sami Barakat <in...@ba...> wrote: > Hi, > I have been learning C++ for about 4 months now from online free > resources and i feel that i would like to gain a better understanding > of > the language and become more advanced at it. I know 4 months isn't > much > time but I have done programming in PHP before and grasped the basics > of > C++ pretty easily. > I am simply asking people from the list if they could recommend any > GOOD > C++ programming books that are not Visual Studio, because i would > like > to program on Linux as well as Windows without having to do major > changes to the code, so will be using the gcc compiler all the time. > It > would also be nice if the book could explain how to program using > sockets ( I know they are different for Windows and Linux ). I am > doing > this more as a hobby at the moment and maybe later on take a course > at > uni in it. Im not too bothered about how much the book may cost, all > i > am really interested in is the clarity of the book and how far i can > go > with it ( I want to go far :) ). > > Thanks in advance for the suggestions. Hi, from my experience, starting programming is a better way to learn the programming language than reading books, besides you'll have to deal with all the error messages later even after you have learned the language, and you'll get a lot of error messages (no joke), and as long as one of thousands of errors remains, your program don't compile. The best resource I've found for practicing C/C++ programming is programming in GTK. It is Linux based, and very straight forward and intuitive. After you've been familiar with GTK programming and conquered your thousands of errors, you are already pretty good at C/C++. The GTK's official website has a very good tutorial. There's another website called something like "C/C++ Frequent Asked Questions", which is very useful because it has a very big list of most of the mistakes people make when programming with C/C++. They also compiled a book with the same name for sale, but the website has more information because it's updated. Sorry I forget the website's address, but if you search the book's name on amazon.com you should be able to find that website. That's my opinion. Besides, the more I program, the more I think it's the design that matters, not how well you memorize the language, because it's the final product that counts, and good design has a better chance of making a better final product than being proficient in that language. Bye. Jack ______________________________________________________________________ Post your free ad now! http://personals.yahoo.ca |
From: invognito i. <mvc...@ho...> - 2004-01-31 06:16:36
|
<html><div style='background-color:'><P><BR><BR></P> <DIV> <DIV class=RTE> <P>Hi I am AFROMEISTER and this is my first ever post to the list,</P> <P>I have been wondering for some time and searched through the forums, but as I am a C++ newbie I have been unable to find any information that I can use about making a library using Dev-C++. My e-mail adress is <A href="mailto:MVC...@ho...">MVC...@ho...</A> and any information or URL's relating to making a library using Dev-C++ would be gratefully reveived.<BR>sincerely thankfull,</P> <P>AFROMEISTER<BR><BR></P></DIV></DIV></div><br clear=all><hr>Hot chart ringtones and polyphonics. <a href="http://g.msn.com/8HMBENAU/2737??PS="> Click here.</a> </html> |
From: <de...@ci...> - 2004-01-31 06:01:21
|
UDTVectorEXPIMP looks like it is probably a template definition. So somewhere in the code someone is saying something like: UDTVectorEXPIMP fred; where it may be that it should be UDTVectorEXPIMP<int> fred; The exact details of what's needed can only be known from finding the definition of UDTVectorEXPIMP to know how many parameters it expects. In article <000001c3e51b$b432ed60$fe97abd4@CALVINBALL>, al...@vi... (Alessandro Bugatti) wrote: > > I downloaded the neoengine.devpak from devpaks.org and I installed it. > I = > use DevC++ 4.9.8.5 and Mingw compiler > I tried to compile some tutorial but the compiler say > =20 > ISO C++ forbids declaration of `UDTVectorEXPIMP' with no type > > Some suggestions? > > Thanks > Alex |
From: Mohammed I. <mi...@ac...> - 2004-01-31 05:08:19
|
Hi.. Note that knowing the language doesn't mean you will be a programmer!! Mohammed |
From: Obi <ob...@ch...> - 2004-01-31 04:51:31
|
At 00:18 29/01/2004 +0000, Miguel Ram=EDrez J=E1vega wrote: >On Wed, 2004-01-28 at 09:04, Oleksandr Yermolenko wrote: > > Hi all, > > Little question about delete operator. > > Can i fall into trouble when making a call "delete this" in the > > class member function ? > > > >What do you mean exactly by "falling into trouble"? Obviously, the first >think one thinks at seeing that is the risk of dangling references. Any >reference to that struct instance will be invalid. And second, valgrind >prompts the following when executing the snippet of code you sent: Also you need to be sure the instance is actually new-ed. If the instance is an automatic or static variable callinf "delete this" will have undefined behaviour, probably bad. If you want to "delete this" you are recommended to have private constructors and destructor. Use a factory method to create objects. |
From: Haakon M. E. <ha...@nh...> - 2004-01-31 04:40:05
|
http://www.ai.mit.edu/people/phw/phw.html is the home page of Patrick Henry Winston, prof. at the artificial = intelligence laboratory at MIT. I recommend reading his "Introduction to = Artifical Intelligence", because it describes human problem solving = solutions. It is very readable, and you'll probably find some insights = you can use. He has also written "On to C++", which I haven't read, but = I can recommend the author ;-) Here is a link to some information about the book, and it is available = from online bookstores. http://www.ai.mit.edu/people/phw/Books/CPPBACK.HTML Yours sincerely, Haakon Meland Eriksen |