so that I can process the absolute coordinate to windows desktop
This shouldn't matter because coordinates in Windows are always with zero,zero being in the top, left corner of the screen. Whether a screen is rotated 90 degrees to one side, or 270 to the other, you get the same origin reference point (top,left).
int g_x = 0;
DWORD WINAPI Add(void* p) //p unused parameter
int i = 0;
for( ; i < 10; i++ )
//Wait for all the 10 threads to complete its execution
//Now print the result.You expect 10 but it may not be...
cout<<"g_x = "<<g_x<<endl;
The above code answers your first question about data race..
Because the order of the execution.
Suppose you have 4 floats a,b,c,d
and you want to sum up them.
In case of serial implementation, it will be like a + b + c + d
But in case of parallel, it may execute like
(a+b) + (c+d)
So the result wont be same.
This answers your 4th question.
Overheard many years ago that "C is strongly typed language". So what's up with unspecified / unknown "standard definition " of int abs (int) overloaded by , again unknown source "standard", to <b>float abs ( float)</b>? Is it just "progress" AKA from plain C to C "whatever is latest derivative of it" or just plain lack of real standards ? Happy coding in 2015 Cheers Vaclav
Sorry I did not specifically say "C++". I should have said "is C++ ( and derivatives ) strongly typed " to make the question clearer. Maybe the question is just irrelevant with overloading, thus academic as I said in title. Cheers Vaclav
Exactly, you said "Overheard many years ago that "C is strongly typed language".", and went on to talk about overloading. I responded that it (overloading) was not C it was C++. So I apologise that my answer was not very clear.
Sorry nor can I. But given what I said about Word and the SO question, it must be possible. Unfortunately it is too many years since I used MFC in anger so I can't even try a few things. I wonder where all the CodeProject MFC experts are?
no. of cities: 4
no. of paths:6
no. of cities: 5
no. of paths:10
#define ALL -1
#define MAXCITIES 10
long*visited;//visited nodes set here
long*min_circuit;//min inner circuit for given node as start node at position indexed 0
long*ham_circuit;//optimal circuit with length stored at position indexed 0
long min_circuit_length;//min circuit lenth for given start node
int n;//city count
long matrix[MAXCITIES][MAXCITIES];//nondirectional nXn symmetric matrix
//to store path distances as sourceXdestination
long INFI;// INFINITY value to be defined by user
// function resets minimum circuit for a given start node
//with setting its id at index 0 and setting furthr node ids to -1
void reset_min_circuit(int s_v_id)
for(int i=1;i\n ids varying from 0 to %d\n",n-1);
//init all matrix distances to infinity
else printf("\n\nNo hamiltonian circuit !");
What research? All versions of Visual Studio build C++ code into a native image.
While true, some versions produce horribly bloated images (ref. the .... was it CDialog library bug in one or two versions of MFC) making them quite unsuitable to use, or produce images impossible to run on anything but the "Latest And Greatest(tm)" Microsoft Operating System.
It does require research to find out about such things.
From my unfortunate experience ( both with VS or VB ) - the challenge is OS and its "references" to "new" VS versions. In my cases my "old" VS 6 code was either automatically or semi-outomatically ( Do you want to convert it?) converted to LATEST VS on PC. It is a "one way" conversion, no returns.
As has been said, moving up the chain of compilers is easier than moving down them.
I strongly suggest creating a brand new solution with VS 2008 and the copying the source files into the structure and adding them.
Migration projects/solutions from Visual Studio 1.52 up to Visual Studio 2010 have all sorts of problems, which only get worse with each conversion. These issues have largely been eliminated in 2010-2013 (though there are some edge cases that are problematic.)
The normal process, is that the compiler converts C language into object modules, and the linker combines object modules and libraries to create an executable program. Google will find you more detailed explanations it you need them.
The same menu, is also created inside in CMainFrm that all command events (even from the CDialog) are routed and handled in there.
The problem is that the acceleration keys in my CDialog are not shown, ie Alt+1 is hidden but the commands are routed just fine.
How can I force to view the acceleration keys inside the CDialog's CMenu ? Note, that I used the LoadAccelerators function successfully on my onInitDialog and I also tried to use ON_COMMAND(xxx,xxxx) in my CDialog without any success.
Can any body help me with C code to solve these two problems since i am not so familiar with C language..Thank you very much.
1.f(N) be the number of points with integer coordinates that are on a circle passing through (0,0), (N,0),(0,N), and (N,N). Figure out f(10000)=? Print out these points.
2.The number 145 is called a curious number,as 1! + 4! + 5! = 1 + 24 + 120 = 145. Find all curious numbers blow 10000 which are equal to the sum of the factorial of their digits. Print out them.