dev-cpp-users Mailing List for Dev-C++ (Page 43)
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: Rafael M. <so...@gm...> - 2007-11-22 21:48:46
|
Hi List Sorry if this become a double post, but Im not sure if the first one land correctly. Well... I have a client udp socket connection and wish to retrieve the client ip address. I will print now the code structure and further information's will come below. SOCKET sock; SOCKADDR_IN sins; int sinsize=sizeof(sins); WSADATA wsa; WSAStartup(MAKEWORD(2,0),&wsa); sins.sin_family=AF_INET; sins.sin_addr.s_addr=inet_addr(ip); sins.sin_port=htons(port); sock=socket(AF_INET,SOCK_DGRAM,0); struct sockaddr_in stLclAddr; int addrLen = sizeof(struct sockaddr_in); int rVal = getsockname(sock,(struct sockaddr FAR *)&stLclAddr,&addrLen); //int rVal = getsockname(sock,(sockaddr *)&stLclAddr,&addrLen); char szIP[MAX_PATH] = "\0"; sprintf(szIP, "%s",inet_ntoa(stLclAddr.sin_addr)); WriteLog(_T(szIP));//writelog just dump the value to a file or somewhere else rVal = getpeername(sock,( struct sockaddr FAR *)&stLclAddr,&addrLen); //rVal = getpeername(sock,(sockaddr *)&stLclAddr,&addrLen); sprintf(szIP, "%s",inet_ntoa(stLclAddr.sin_addr)); WriteLog(_T(szIP)); When i run the follow code, the output sin_addr is always 204.204.204.204, I don't know why. I cant bind the socket because i like the sysop api give-me the in port (to recvfrom), and i just don't know witch interface on the client machine have Internet connection (and don't like to search. let the sysop do their jobs alone). After know that ip and port, i need to sniff this interface(that job is already done, and need the ip input information to watch the inbound packets and pick, from the packet header, my outside ip:port. with that, I can have a listener on the client and set up ip and port in the server sending a command by UPD). Thanks in advance. -- Regards Rafael Menezes |
From: Rafael M. <so...@gm...> - 2007-11-22 19:30:52
|
Hi List I have a client udp socket connection and wish to retrieve the client ip address. I will print now the code structure and further information's will come below. SOCKET sock; SOCKADDR_IN sins; int sinsize=sizeof(sins); WSADATA wsa; WSAStartup(MAKEWORD(2,0),&wsa); sins.sin_family=AF_INET; sins.sin_addr.s_addr=inet_addr(ip); sins.sin_port=htons(port); sock=socket(AF_INET,SOCK_DGRAM,0); struct sockaddr_in stLclAddr; int addrLen = sizeof(struct sockaddr_in); int rVal = getsockname(sock,(struct sockaddr FAR *)&stLclAddr,&addrLen); //int rVal = getsockname(sock,(sockaddr *)&stLclAddr,&addrLen); char szIP[MAX_PATH] = "\0"; sprintf(szIP,"%s",inet_ntoa(stLclAddr.sin_addr)); WriteLog(_T(szIP));//writelog just dump the value to a file or somewhere else rVal = getpeername(sock,(struct sockaddr FAR *)&stLclAddr,&addrLen); //rVal = getpeername(sock,(sockaddr *)&stLclAddr,&addrLen); sprintf(szIP,"%s",inet_ntoa(stLclAddr.sin_addr)); WriteLog(_T(szIP)); When i run the follow code, the output sin_addr is always 204.204.204.204, I don't know why. I cant bind the socket because i like the sysop api give-me the in port (to recvfrom), and i just don't know witch interface on the client machine have Internet connection (and don't like to search. let the sysop do their jobs alone). After know that ip and port, i need to sniff this interface(that job is already done, and need the ip input information to watch the inbound packets and pick, from the packet header, my outside ip:port. with that, I can have a listener on the client and set up ip and port in the server sending a command by UPD). Thanks in advance. -- Regards Rafael Menezes |
From: Benjamin B. <be...@we...> - 2007-11-22 00:11:20
|
I'm currently looking for a somewhat more flexible associative container than std::map that can do the following: std::map< keyT, valT, lessOp > m; keyT K; otherT O; // lessOp and operator== were defined to work "between" keyT _and_ otherT, see below ... fill the map ... m[K] = valT("blubb"); assert( K == T ); // lets say K and T were build the way this assertion always holds it = m.find[O]; // bang std::map can't do that, just because find( const keyT& ) is definde only for keyT ->compiler error but, as for the concept of an associative container it should be enough that a otherT can be comparet to the maps keyT, or will this lead to further problems? some template members like template< typname otherT > ...iterator... find( const otherT& ) { ... } in the map template definition should do? probably not all of the map implemention must be rewritten. but if it works, someone must have done it before, and I don't want to invent the map again :) thanks for your ideas ... #################################### // defined before code above: // comparing struct: struct lessOp { bool operator()( const keyT& k, const otherT& o ); bool operator()( const otherT& o, const keyT& k ); bool operator()( const keyT& k, const keyT& k ); } //... and a functions to test for equality bool operator==( const keyT& k, const otherT& o ); bool operator==( const otherT& k, const keyT& o ); bool operator==( const keyT& k, const keyT& o ); #################################### |
From: Fernando L. <fer...@gm...> - 2007-11-21 19:07:25
|
Be careful with programming small processors like the PIC, they do not have enough stack depth to support deeply nested calls or large argument lists. = I wouldn't recommend using C++, stick to C. And generally, there is no "operating system". Best regards, Fernando On Nov 21, 2007 3:47 PM, Pink Boy <da...@ya...> wrote: > Andr=E9 Mac=E1rio Barros sez, > > > Sorry, but I didn=B4t understand the stack realease sfuff... > > Local variables are generally allocated on the functions stack > frame. Once you return from a function the local variables are no > longer valid. A pointer to a local variable is no longer valid > once you've returned from the function. Thus you need to take a > lot of care when referencing local variables via pointers. > > > -->Suppose I make a lot of malloc=B4s during the > > execution of my program. Then I finish the execution (without > > "freeing" the memory). > > > -->Does all the "malloced" memory return to > > the Operating System and can be considered available again? > > With Winders, probably. Other OS's probably not. The real issue is > that not keeping track of memory that has been allocated via malloc > is bad programming practice as it leads directly to memory leaks. > > Mr Foo > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > --=20 Fernando Lichtschein li...@fi... |
From: Pink B. <da...@ya...> - 2007-11-21 18:47:21
|
Andr=E9 Mac=E1rio Barros sez, > Sorry, but I didn=B4t understand the stack realease sfuff... Local variables are generally allocated on the functions stack frame. Once you return from a function the local variables are no longer valid. A pointer to a local variable is no longer valid once you've returned from the function. Thus you need to take a lot of care when referencing local variables via pointers. =20 > -->Suppose I make a lot of malloc=B4s during the > execution of my program. Then I finish the execution (without > "freeing" the memory). > -->Does all the "malloced" memory return to > the Operating System and can be considered available again? With Winders, probably. Other OS's probably not. The real issue is that not keeping track of memory that has been allocated via malloc is bad programming practice as it leads directly to memory leaks. Mr Foo |
From: <and...@su...> - 2007-11-21 17:04:57
|
I don´t know the size of your "heap-patience", people :-)) But... -When I do a malloc for a simple vector, can´t I discover if its memory is shared with other lockable stuff? -Does the Operating System decide by itself to do this kind of sharing mode, or do I need to do it through my program? Thinking in another way... -This "driver or similar" belongs to my application, doesn´t it? If it´s true, I know if my program is using this kind of lockable memory, don´t I? (I think it´s the last) Thank you!!! Andre -----Mensagem original----- De: Rafael Menezes [mailto:so...@gm...] Enviada em: quarta-feira, 21 de novembro de 2007 13:19 Para: André Macário Barros Assunto: Re: [Dev-C++] RES: RES: RES: Question about software design Hi André Yes and No. That depends of how you have allocated that memory. Some functions can alloc shared memory (Yes Per, that is exactly (RAM disk) what am I doing in that app). This ones you must free by hand or they will keep in there until a system restart or something like (Memory clean tools... i don't know. Maybe some vb script with a mychar(999999) inside ;). I think Per have just released a better text in that subject. Here comes: "When you run an application under Win32, the C or C++ library contains the heap implementation (malloc(), calloc(), new, ...) and requests memory from the OS. The OS keeps track of all memory pages it gives to the application. It has to, since the processor is running in protected mode with a Memory Management Unit (MMU) to map between logical and physical memory addresses. Whenever the application ends, the OS can release all memory pages that was mapped to the application. Only if the memory page is shared with a driver or similar, and the driver has the page locked, will the OS have to keep the memory page until the lock is released." That answer your question (with a big YES if the next sentence doesn't fit to your application.), and explain my app behavior. Regards Rafael No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.503 / Virus Database: 269.16.2/1142 - Release Date: 20/11/2007 17:44 |
From: <and...@su...> - 2007-11-21 15:48:26
|
Sorry, but I didn´t understand the stack realease sfuff... -->Suppose I make a lot of malloc´s during the execution of my program. Then I finish the execution (without "freeing" the memory). -->Does all the "malloced" memory return to the Operating System and can be considered available again? Thank you! Andre -----Mensagem original----- De: Rafael Menezes [mailto:so...@gm...] Enviada em: quarta-feira, 21 de novembro de 2007 10:02 Para: André Macário Barros Assunto: Re: [Dev-C++] RES: RES: Question about software design Hi André. I'm not asking about some particular language skill's, and if you are using ANSI C, that is great. Not much people see that ANSI C is faster than anything else (with one exception to assembly, but assembly... oh joy...), and can be used in many places of the code in order to increase speed and memory usage. Keep using that everywhere it fits. About that automatic memory release, well... the memory will be cleaned up in most cases, but you cant count on that. Sometimes (each time you ask for a new memory space that is bigger than the actual remaining stack on the SO, reserved to your application), you can just see your memory leaking and don't have a thread to kill and stop this beast. The normal memory management functions supplied with C compilers do not provide garbage collection. free and calloc still can be useful in your code. Regards Rafael No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.503 / Virus Database: 269.16.2/1142 - Release Date: 20/11/2007 17:44 |
From: Per W. <pw...@ia...> - 2007-11-21 13:05:47
|
The free() before program termination isn't needed when the application is run under any normal operating system. But when talking embedded systems, there is normally no such resource manager available in the OS - if there even is an OS. Cleaning up memory is a good thing to do even when not needed. One reason is that you can use automatic tools to find memory leaks - the allocations that you have forgotten, and that may be located inside some form of loop and result in a program failure after some time because you run out of memory. Without a free() at the end of program, the test will always complain about "lost" memory, and you will always ignore the result of the test - so you will not notice these unexpected leaks. One example of an often forgotten leak is strdup(). /pwm On Wed, 21 Nov 2007, Andr=E9 Mac=E1rio Barros wrote: > I understood that you are asking about the advances C++ can > give us in these aspects, right? > > My interest is to focus the code only in ANSI C for some reasons. > One of them is to put the same code in a C-microcontroler, like > PIC16F877, with a minimum level of modification. > > But, let me make one question related to this: I=B4ve read here that > the free() command isn=B4t necessary, is it? At the end of the execution > of the program all the dynamic memory requested is released > automatically. Is that true? > > Regards > Andre > -----Mensagem original----- > De: Rafael Menezes [mailto:so...@gm...] > Enviada em: quarta-feira, 21 de novembro de 2007 01:18 > Para: Andr=E9 Mac=E1rio Barros > Cc: Lista do Dev-C++ > Assunto: Re: [Dev-C++] RES: Question about software design > > > Sorry Chris.... > > So.... you just don't like to use new and delete, correct? That isn't t= he > ready-to-go way to alloc memory, use for any time and free as you wish, i= n > c++ (I use that all the time. Truly, I don't use static variables anymore= , > in C and C++.)? (same is true to c with free and calloc). This approach c= an > be very useful if you are not interested in reinvent the wheel (Like proo= f > of concept and other study cases.) > > > -- > Regards > Rafael Menezes > No virus found in this outgoing message. > Checked by AVG Free Edition. > Version: 7.5.503 / Virus Database: 269.16.2/1142 - Release Date: 20/11/20= 07 > 17:44 > |
From: <and...@su...> - 2007-11-21 11:18:48
|
I understood that you are asking about the advances C++ can give us in these aspects, right? My interest is to focus the code only in ANSI C for some reasons. One of them is to put the same code in a C-microcontroler, like PIC16F877, with a minimum level of modification. But, let me make one question related to this: I´ve read here that the free() command isn´t necessary, is it? At the end of the execution of the program all the dynamic memory requested is released automatically. Is that true? Regards Andre -----Mensagem original----- De: Rafael Menezes [mailto:so...@gm...] Enviada em: quarta-feira, 21 de novembro de 2007 01:18 Para: André Macário Barros Cc: Lista do Dev-C++ Assunto: Re: [Dev-C++] RES: Question about software design Sorry Chris.... So.... you just don't like to use new and delete, correct? That isn't the ready-to-go way to alloc memory, use for any time and free as you wish, in c++ (I use that all the time. Truly, I don't use static variables anymore, in C and C++.)? (same is true to c with free and calloc). This approach can be very useful if you are not interested in reinvent the wheel (Like proof of concept and other study cases.) -- Regards Rafael Menezes No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.503 / Virus Database: 269.16.2/1142 - Release Date: 20/11/2007 17:44 |
From: Rafael M. <so...@gm...> - 2007-11-21 04:18:31
|
Sorry Chris.... So.... you just don't like to use new and delete, correct? That isn't the ready-to-go way to alloc memory, use for any time and free as you wish, in c++ (I use that all the time. Truly, I don't use static variables anymore, in C and C++.)? (same is true to c with free and calloc). This approach can be very useful if you are not interested in reinvent the wheel (Like proof of concept and other study cases.) -- Regards Rafael Menezes |
From: Chris M. <lor...@gm...> - 2007-11-21 02:01:24
|
Sorry about forgetting to post to the list... that gets me most every time. André Macário Barros wrote: > Dear Mr. Miller, > > It´s not exactly this. > Let me show what I said in another way: > ////////////////////////////////////////// > file1.c > #include "tasks1.h" > #include "tasks2.h" > main() > { > int *v1, *v2, **v3, i; > int value; > > AllocateRes(&v1, &v2, &v3); > for(i=0; i<10000; i++){ > function1(v1, v2); > function2(v1, v2, v3); > value = function3(v2); > } > printf("and the best answer is %d\n", value); > FreeRes(&v1, &v2, &v3); > } > ////////////////////////////////////////// > task1.c (function definitions of task1) > void function1(int *v1, int *v2) > { > // update values of v1 and v2 > } > ////////////////////////////////////////// > task2.c (function definitions of task2) > void function2(int **v3) > { > // update values of v3 > } > int GiveAnswer(int *v2) > { > int value; > > //blah blah blah code > return(value); > } > ////////////////////////////////////////// > I only need to declare v1 and v3 inside > the main() scope to allocate memory through > AllocateRes (and to release after). > If I move v1 and v3 inside function1 or > function2, I will need to make 10000 malloc´s > and free´s. > The only variables (the real ones) needed > to be in main() function are "i", "v2" and "value". If you want to get very technical you could put them on the call stack by making it main(int arg0, int *v1, int *v2, int **v3, int i), since the call stack is freed at the end of the program's execution. > The time I wrote for the list from now, I though > in something like a static variable which can > detect the first time the function is called > and do the malloc. The same procedure could be > made to detect the last function call to do the > free. > > But do you know any other way? As far as I know, all function arguments are put on a call stack via the C/C++ function stack, which frees everything when the function completes. Overall, you've already done a very good job, since the memory is allocated once, used many times, and then deallocated. If you did not allocate that memory outside the loop, yes, you would have 10,0000 calls to malloc, and 10,000 calls to free. Creating a special hook function to detect when objects pass out of scope in this case is quite overkill. These are simple arrays, and don't need to be watched that closely because they aren't going that far. If you want to get into some cool stuff, check out boost.org and their C++ "Smart" pointer, which counts the number of references to an object and destroys it once the reference count is zero (when it falls out of scope). However, this is only for systems where multiple classes and potentially multiple threads are using the same data. On most modern operating systems memory that is used is freed to the system at the end of the program's execution, with a few exceptions. Overall, aside from profiling it and running Valgrind (a memory leak checker) I can't find anything to do differently. If you're really worried about performance and memory leaks, just profile and check it! There are many open-source, free to use profilers and memory leak checkers which you can use to isolate exactly which parts of your application chew up the most time, and where the memory is leaking from. And about that putting everything on the call stack... I wouldn't really suggest doing that, because it wasn't really designed for that, however, in the Overly Obfuscated C Code Competition I did see one bloke use that trick to write a 3D maze renderer without declaring a single variable outside of the main() function's calling arguments. It was quite cool. He basically called main() a number of times until he had the memory he wanted and... you can look it up if you're interested. You're on the right path, I don't seen any need for change. Perhaps someone more experienced can find something more. |
From: <and...@su...> - 2007-11-21 01:41:09
|
Dear Mr. Miller, It´s not exactly this. Let me show what I said in another way: ////////////////////////////////////////// file1.c #include "tasks1.h" #include "tasks2.h" main() { int *v1, *v2, **v3, i; int value; AllocateRes(&v1, &v2, &v3); for(i=0; i<10000; i++){ function1(v1, v2); function2(v1, v2, v3); value = function3(v2); } printf("and the best answer is %d\n", value); FreeRes(&v1, &v2, &v3); } ////////////////////////////////////////// task1.c (function definitions of task1) void function1(int *v1, int *v2) { // update values of v1 and v2 } ////////////////////////////////////////// task2.c (function definitions of task2) void function2(int **v3) { // update values of v3 } int GiveAnswer(int *v2) { int value; //blah blah blah code return(value); } ////////////////////////////////////////// I only need to declare v1 and v3 inside the main() scope to allocate memory through AllocateRes (and to release after). If I move v1 and v3 inside function1 or function2, I will need to make 10000 malloc´s and free´s. The only variables (the real ones) needed to be in main() function are "i", "v2" and "value". The time I wrote for the list from now, I though in something like a static variable which can detect the first time the function is called and do the malloc. The same procedure could be made to detect the last function call to do the free. But do you know any other way? Thank you! Andre -----Mensagem original----- De: Chris Miller [mailto:lor...@gm...] Enviada em: terça-feira, 20 de novembro de 2007 22:05 Para: André Macário Barros Assunto: Re: [Dev-C++] Question about software design André Macário Barros wrote: > Dear users, > > a) I have a project file, with some .c and .h files; > b) the main() function is worried in only find one answer, > which is the best distance (an integer) and the best tour, > an 1-D vector; > c)to find this answer, I have to manipulate a lot of 1-D and > 2-D vectors, and other simple variables in specific functions. > I´m using parameter passing functions; > d) the size of these vectors is variable and it depends of the > user settings. So, I have to use dynamic allocation with pointers; > e) I´m using two functions: AllocateResources() in the beginning > of the execution and FreeResources() at the end to do all the > allocations needed to run my functions. These functions are in > the main() scope. Because of this, all the vectors need to be > declared in the main(). > > My problem is: > Many of these vectors are only related to specific functions, > that is, they are only used in some functions and I have to > make reference to them in the main() scope. > If I put the allocation inside the functions, I will make > thousands of malloc´s and free´s for the same thing! > > My question is: > Is there any clever way to do this (make only one allocation, > run the program, free the resources at the end of the execution > and DON´T NEED TO EXIBIT ALL THESE RESOURCES-the vectors IN THE > main() SCOPE)? What I think you're trying to say is that you have a bunch of variables declared above your main() function, and that you don't want them to be there, however, you want to be able to manipulate them in the scope of main(). Am I right? I don't want to proceed any further without clarifying because I'm not entirely sure I understand what you're asking. No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.503 / Virus Database: 269.16.1/1140 - Release Date: 19/11/2007 19:05 No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.503 / Virus Database: 269.16.1/1140 - Release Date: 19/11/2007 19:05 |
From: Chris M. <lor...@gm...> - 2007-11-21 01:11:16
|
angel dario wrote: > > Any body knows where can i find a complete online tutorial of OLE2.h? > Or maybe a miniturial.. > > I searched on google and couldn't find a decent tutorial. http://www.infotomic.com/store/win32tlb/reference.php?subject=2 Third down in Google Page Rank for search "OLE2" on 20 November 2007, 5:10PM PST. |
From: angel d. <sci...@ho...> - 2007-11-20 21:57:48
|
Any body knows where can i find a complete online tutorial of OLE2.h? Or maybe a miniturial.. I searched on google and couldn't find a decent tutorial. _________________________________________________________________ Your smile counts. The more smiles you share, the more we donate.=A0 Join i= n. www.windowslive.com/smile?ocid=3DTXT_TAGLM_Wave2_oprsmilewlhmtagline= |
From: <and...@su...> - 2007-11-20 17:28:09
|
Dear users, a) I have a project file, with some .c and .h files; b) the main() function is worried in only find one answer, which is the best distance (an integer) and the best tour, an 1-D vector; c)to find this answer, I have to manipulate a lot of 1-D and 2-D vectors, and other simple variables in specific functions. I´m using parameter passing functions; d) the size of these vectors is variable and it depends of the user settings. So, I have to use dynamic allocation with pointers; e) I´m using two functions: AllocateResources() in the beginning of the execution and FreeResources() at the end to do all the allocations needed to run my functions. These functions are in the main() scope. Because of this, all the vectors need to be declared in the main(). My problem is: Many of these vectors are only related to specific functions, that is, they are only used in some functions and I have to make reference to them in the main() scope. If I put the allocation inside the functions, I will make thousands of malloc´s and free´s for the same thing! My question is: Is there any clever way to do this (make only one allocation, run the program, free the resources at the end of the execution and DON´T NEED TO EXIBIT ALL THESE RESOURCES-the vectors IN THE main() SCOPE)? Regards Andre No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.503 / Virus Database: 269.16.1/1140 - Release Date: 19/11/2007 19:05 |
From: <ta...@fe...> - 2007-11-16 23:50:48
|
------------------------------------------------------------------------ ------------------------------------------------------- (Apologies for cross-posting) Symposium =93Image Processing and Analysis=94 International Conference on Computational and Experimental Engineering & Sciences 2008 (ICCES'08) USA, 17-22 March 2008 http://icces.org/cgi-bin/ices08/pages/index We would appreciate if you could distribute this information by your colleagues and co-workers. ------------------------------------------------------------------------ ------------------------------------------------------- Dear Colleague, Within the International Conference on Computational and Experimental Engineering & Sciences 2008 (ICCES'08), to be held in USA, in 17-22 March 2008, we are organizing the Symposium =93Image Processing and Analysis=94. Examples of some topics that will be considered in that symposium are: Image restoring, Image description, Image compression, Image segmentation, Objects description, Objects tracking, Objects matching, Objects reconstruction, Objects Registration, Software Development for Image Processing and Analysis, Grid Computing in Image Processing and Analysis, Applications of Image Processing and Analysis. Due to your research activities in those fields, we would like to invite you to submit your work and participate in the Symposium =93Image Processing and Analysis=94. For instructions and submission, please access to the conference website at: http://icces.org/cgi-bin/ices08/pages/index. Please note that, when submitting your work you should choose the Symposium =93Image Processing and Analysis=94. Important dates: - 15 Dec 2007: Deadline for abstract submission; - 20 Dec 2007: End of abstract selection; - 1 Feb 2008: Deadline for final 6-page paper submission. Kind regards, Jo=E3o Manuel R. S. Tavares (ta...@fe...) Renato Natal Jorge (rn...@fe...) (University of Porto, Portugal - Symposium organizers) |
From: Jonathan W. <jon...@gm...> - 2007-11-15 19:39:46
|
Steven also has a good point. Gtk is quite good looking, (and themeable I believe) If you're using C++ you'll probably rather use gtkmm, the C++ bindings for GTK+ cheers, Jonathan On 11/15/07, Steven Carter <ste...@gm...> wrote: > > > GTK+ might be more to your liking http://www.gtk.org/ if you're interested > in prettier visual styles. > > > > On 15/11/2007, Chris Miller <lor...@gm...> wrote: > > > > On Nov 15, 2007 7:44 AM, angel dario <sci...@ho...> > > wrote: > > > I know wxWidgets, and i like them but.... > > > > > > > > > They don't support cool looking things like water button and others... > > > > > > > > Is there a library out there that has these good looking things? > > > > As a pre-built skin, I don't think it exists in wxWidgets. However, > > I'm sure you could write your own custom widget for wxWidgets to do > > that. I don't know, however, since I've never used wxWidgets. > > > > -- > > Registered Linux Addict #431495 > > http://profile.xfire.com/mrstalinman > > John 3:16! > > > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by: Splunk Inc. > > Still grepping through log files to find problems? Stop. > > Now Search log events and configuration files using AJAX and a browser. > > Download your FREE copy of Splunk now >> http://get.splunk.com/ > > _______________________________________________ > > 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 > > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > 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 > > -- <Morpheus> linux, c'est une question de VI ou de MORE |
From: Per W. <pw...@ia...> - 2007-11-15 19:13:34
|
Because "C++ GUI" is old??? Did you mean Dev-C++? In that case just switch to Code::Blocks. It takes a huge amount of time and work to write a new IDE, and there already exists a number of excellent IDEs out there. Crreating new widgets using wxWidgets is easy. The information available on the home page is excellent. And there are a huge number of sample programs how to develop applications. /pwm On Thu, 15 Nov 2007, angel dario wrote: > Any body knows how to write a custom widget using wxWidgets???? > All i'm seeking for is to create my own GUI... because C++ GUI is OLD!!!! > > > > > Date: Thu, 15 Nov 2007 07:59:29 -0800 > > From: lor...@gm... > > To: sci...@ho... > > Subject: Re: [Dev-C++] GUI > > CC: dev...@li... > > > > On Nov 15, 2007 7:44 AM, angel dario <sci...@ho...> w= rote: > > > I know wxWidgets, and i like them but.... > > > > > > > > > They don't support cool looking things like water button and others..= =2E > > > > > > Is there a library out there that has these good looking things? > > > > As a pre-built skin, I don't think it exists in wxWidgets. However, > > I'm sure you could write your own custom widget for wxWidgets to do > > that. I don't know, however, since I've never used wxWidgets. > > > > -- > > Registered Linux Addict #431495 > > http://profile.xfire.com/mrstalinman > > John 3:16! > > _________________________________________________________________ > Windows Live Hotmail and Microsoft Office Outlook =96 together at last. = =A0Get it now. > http://office.microsoft.com/en-us/outlook/HA102225181033.aspx?pid=3DCL100= 626971033 |
From: Jonathan W. <jon...@gm...> - 2007-11-15 18:35:47
|
Hi, You'd have better luck on a wxWidgets mailing list... On 11/15/07, angel dario <sci...@ho...> wrote: > > Any body knows how to write a custom widget using wxWidgets???? > All i'm seeking for is to create my own GUI... because C++ GUI is OLD!!!! > > > > ------------------------------ > > Date: Thu, 15 Nov 2007 07:59:29 -0800 > > From: lor...@gm... > > To: sci...@ho... > > Subject: Re: [Dev-C++] GUI > > CC: dev...@li... > > > > On Nov 15, 2007 7:44 AM, angel dario <sci...@ho...> > wrote: > > > I know wxWidgets, and i like them but.... > > > > > > > > > They don't support cool looking things like water button and others..= . > > > > > > Is there a library out there that has these good looking things? > > > > As a pre-built skin, I don't think it exists in wxWidgets. However, > > I'm sure you could write your own custom widget for wxWidgets to do > > that. I don't know, however, since I've never used wxWidgets. > > > > -- > > Registered Linux Addict #431495 > > http://profile.xfire.com/mrstalinman > > John 3:16! > > ------------------------------ > Windows Live Hotmail and Microsoft Office Outlook =96 together at last. G= et > it now!<http://office.microsoft.com/en-us/outlook/HA102225181033.aspx?pid= =3DCL100626971033> > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > --=20 <Morpheus> linux, c'est une question de VI ou de MORE |
From: Steven C. <ste...@gm...> - 2007-11-15 18:35:47
|
GTK+ might be more to your liking http://www.gtk.org/ if you're interested in prettier visual styles. On 15/11/2007, Chris Miller <lor...@gm...> wrote: > > On Nov 15, 2007 7:44 AM, angel dario <sci...@ho...> > wrote: > > I know wxWidgets, and i like them but.... > > > > > > They don't support cool looking things like water button and others... > > > > Is there a library out there that has these good looking things? > > As a pre-built skin, I don't think it exists in wxWidgets. However, > I'm sure you could write your own custom widget for wxWidgets to do > that. I don't know, however, since I've never used wxWidgets. > > -- > Registered Linux Addict #431495 > http://profile.xfire.com/mrstalinman > John 3:16! > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > 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: angel d. <sci...@ho...> - 2007-11-15 18:32:54
|
Any body knows how to write a custom widget using wxWidgets???? All i'm seeking for is to create my own GUI... because C++ GUI is OLD!!!! > Date: Thu, 15 Nov 2007 07:59:29 -0800 > From: lor...@gm... > To: sci...@ho... > Subject: Re: [Dev-C++] GUI > CC: dev...@li... >=20 > On Nov 15, 2007 7:44 AM, angel dario <sci...@ho...> wro= te: > > I know wxWidgets, and i like them but.... > > > > > > They don't support cool looking things like water button and others... > > > > Is there a library out there that has these good looking things? >=20 > As a pre-built skin, I don't think it exists in wxWidgets. However, > I'm sure you could write your own custom widget for wxWidgets to do > that. I don't know, however, since I've never used wxWidgets. >=20 > --=20 > Registered Linux Addict #431495 > http://profile.xfire.com/mrstalinman > John 3:16! _________________________________________________________________ Windows Live Hotmail and Microsoft Office Outlook =96 together at last. =A0= Get it now. http://office.microsoft.com/en-us/outlook/HA102225181033.aspx?pid=3DCL10062= 6971033= |
From: Per W. <pw...@ia...> - 2007-11-15 18:13:36
|
LOL About RAR or any other archive. Not too many people take the time to open archves or other archives - especially since all non-text archives must be suspected - to be able to answer questions. The source and the error messages could have been sent directly inline in the mail. Much faster and easier! /pwm On Thu, 15 Nov 2007, Chris Miller wrote: > Just another pointer, when putting things on the Internet, don't use > RAR format. Use ZIP, since literally everyone can use it. Readers > for RAR format aren't available on every machine (particularly the > idiot school terminal I'm using) and limits the number of people who > can reply. > > Per is actually a computerized bot, so he's usually the first to > reply, just so you know. *ducks* > > -- > Registered Linux Addict #431495 > http://profile.xfire.com/mrstalinman > John 3:16! > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > 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: Chris M. <lor...@gm...> - 2007-11-15 15:59:37
|
On Nov 15, 2007 7:44 AM, angel dario <sci...@ho...> wrote: > I know wxWidgets, and i like them but.... > > > They don't support cool looking things like water button and others... > > Is there a library out there that has these good looking things? As a pre-built skin, I don't think it exists in wxWidgets. However, I'm sure you could write your own custom widget for wxWidgets to do that. I don't know, however, since I've never used wxWidgets. -- Registered Linux Addict #431495 http://profile.xfire.com/mrstalinman John 3:16! |
From: Chris M. <lor...@gm...> - 2007-11-15 15:56:46
|
Just another pointer, when putting things on the Internet, don't use RAR format. Use ZIP, since literally everyone can use it. Readers for RAR format aren't available on every machine (particularly the idiot school terminal I'm using) and limits the number of people who can reply. Per is actually a computerized bot, so he's usually the first to reply, just so you know. *ducks* -- Registered Linux Addict #431495 http://profile.xfire.com/mrstalinman John 3:16! |
From: angel d. <sci...@ho...> - 2007-11-15 15:44:56
|
I know wxWidgets, and i like them but.... =20 =20 They don't support cool looking things like water button and others... =20 Is there a library out there that has these good looking things? _________________________________________________________________ Climb to the top of the charts!=A0 Play Star Shuffle:=A0 the word scramble = challenge with star power. http://club.live.com/star_shuffle.aspx?icid=3Dstarshuffle_wlmailtextlink_oc= t= |