No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
17 Posted Topics
![]() | Re: The code for srand() and rand() is [CODE]void __cdecl srand (unsigned int seed) { #ifdef _MT _getptd()->_holdrand = (unsigned long)seed; #else /* _MT */ holdrand = (long)seed; #endif /* _MT */ } int __cdecl rand (void) { #ifdef _MT _ptiddata ptd = _getptd(); return( ((ptd->_holdrand = ptd->_holdrand * 214013L + … ![]() |
Re: [CODE]#include <stdio.h> #include <stdlib.h> #include <time.h> void thread_function( void* arg ) { time_t start, finish; long loop; double result, elapsed_time; time( &start ); // Your thread code time( &finish ); elapsed_time = difftime( finish, start ); printf( "\nThread takes %6.0f seconds.\n", elapsed_time ); }[/CODE] The code counts for the execution … | |
Re: Optimizing the tree can be really tricky but there are some ways to do it. So if the parent node is '*' and one of the child nodes is 0 then you can delete the child nodes. For changing x + x in 2 * x it doesn't really matter … | |
Re: A more elegant solution to this problem is to search in all directions for the improvement and advance step-by-step, like optimization methods do. [CODE]#include <stdio.h> float functionValue( float x, float y ) { if ( y != 1 ) return ( x + 1 ) / ( y - 1 … | |
Re: so it looks like the path to the .cpp file is wrong: g++: no input files I haven't work with eclipse on windows but in unix the include path of th makefile finished with "-I" : -I"c:\MinGW\lib\gcc\mingw32\4.5.0\include\c++\tr1\" -I. or: -I c:\MinGW\lib\gcc\mingw32\4.5.0\include\c++\tr1\ -I. | |
Re: Copy-paste active.dll in your project folder or set enviorment variable to active.dll location | |
Re: use [CODE] system("file.exe");[/CODE] | |
I'm trying to compile the linux source code release of Axis2/C on MacOS but I'm getting errors at building axutil.h. I've tried to apply different patches without success, and I even found a website that explained the necessary modifications in the code and I made them but they still didn't … | |
Re: The [I]shutdown[/I] function disables sends or receives on a socket and you are using the ConnectSocket after the [I]shutdown[/I] function to receive info. The [I]shutdown [/I]function is normally used before the [I]close[/I] function so that you stop the stream flow before you close the socket. | |
Re: did you included the header ( .h ) in the .cpp file? | |
Re: your problem is here: [CODE]if (i = -1)[/CODE] the condition is always true try using [CODE]if (i == -1)[/CODE] | |
Re: Here's a tutorial: [url]http://www.cplusplus.com/doc/tutorial/classes/[/url] | |
Re: I think that the problem appears when you are casting the [I]char[/I] to [I]int[/I] (if the character is '\n' or ' ' that is impossible, plus your comparing an [I]int[/I] with EOF) try using the [I]fscanf[/I] function. fscanf (fp,"%d",ch); | |
Re: if you like to see the rectangle grow you will habe to work with the MouseMove event. You wil have to the previous rectangle when the mouse position has changed. Here's a good tutorial. [url]http://www.geocities.com/Heartland/Meadows/9818/win32tut/gdi.html[/url] | |
I have created a win32 application in which you can draw different objects(lines, rectangles, etc.) and now I want to save the drawings as bmp files because I already now how to load bmp files. These is as far as I got: [CODE]void OnSave(HWND hWnd) { OPENFILENAME openFile; TCHAR szPath[MAX_PATH]; … |
The End.