 |
 |
Apologies for the shouting but this is important.
When answering a question please:
- Read the question carefully
- Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
- If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
- If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid.
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|
 |
For those new to message boards please try to follow a few simple rules when posting your question.- Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
- Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
- Keep the subject line brief, but descriptive. eg "File Serialization problem"
- Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
- Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
- Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
- If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode HTML tags when pasting" checkbox before pasting anything inside the PRE block, and make sure "Ignore HTML tags in this message" check box is unchecked.
- Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
- Please do not post links to your question in one forum from another, unrelated forum (such as the lounge). It will be deleted.
- Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
- If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
- No advertising or soliciting.
- We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|
 |
/*
TEST WITH THE FOLLOWING
PROBLEM 1
inputs:
infinity:999
no. of cities: 4
no. of paths:6
PROBLEM 2
inputs:
infinity:999
no. of cities: 5
no. of paths:10
*/
#include
#define ALL -1
#define MAXCITIES 10
enum BOOL{FALSE,TRUE};
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)
{
min_circuit[0]=s_v_id;
for(int i=1;i\n ids varying from 0 to %d\n",n-1);
//init all matrix distances to infinity
for(i=0;i ",ham_circuit[i]);
}
else printf("\n\nNo hamiltonian circuit !");
delete []visited;
delete []min_circuit;
delete []ham_circuit;
}
|
|
|
|
 |
/*
TEST WITH THE FOLLOWING
PROBLEM 1
inputs:
infinity:999
no. of cities: 4
no. of paths:6
PROBLEM 2
inputs:
infinity:999
no. of cities: 5
no. of paths:10
*/
#include
#define ALL -1
#define MAXCITIES 10
enum BOOL{FALSE,TRUE};
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)
{
min_circuit[0]=s_v_id;
for(int i=1;i\n ids varying from 0 to %d\n",n-1);
//init all matrix distances to infinity
for(i=0;i ",ham_circuit[i]);
}
else printf("\n\nNo hamiltonian circuit !");
delete []visited;
delete []min_circuit;
delete []ham_circuit;
}
|
|
|
|
 |
HI ALL,
I was working building Visual C++ software using Visual Studio 6.
Now I have Visual Studio 2008 and still have this C++ project.
if I want to rebuild it on Visual Studio 2008, what are the attentions I shall pay?
diligent hands rule....
|
|
|
|
 |
Add the project, build it, and see what happens.
|
|
|
|
 |
good point. based on my research, it shall be the same because Visual Studio 2013 can still build native C++ image.
diligent hands rule....
|
|
|
|
 |
Southmountain wrote: based on my research What research? All versions of Visual Studio build C++ code into a native image.
|
|
|
|
 |
Does anyone know how c language is used to make a software. Normally we run small c programs in a compiler but what is actualy done in making a software ........
|
|
|
|
 |
What do you mean by "making a software "?
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.
|
|
|
|
 |
I also want to know project in vending machine .I have a project. Some one help for this
|
|
|
|
|
 |
Please read this[^].
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
|
|
|
|
 |
I also want to know project in vending machine .I have a project. Some one help for this
|
|
|
|
 |
I create dynamically a CMenu inside a CDialog that have some acceleration keys ie
m_pBCMenu->AppendMenu(MF_STRING, ID_MENU_STRETCH_NORMAL, _T("&Size\tAlt+1"));
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.
Any recommendations ?
sdancer75
|
|
|
|
|
 |
Hi,
I don't mean the underline char accelerators but the keyboard shortcuts ie Ctrl-F1 that are loaded with LoadAccel(). I already read the article you pointed to me, but does not fit in my case.
Regards,
sdancer75
|
|
|
|
 |
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.
|
|
|
|
 |
1. Nobody is going to do your homework for you.
2. Lack of planning on your part does not constitute urgency on our part.
3. Try to do it yourself, and when you get stuck ask a specific question and we'd be glad to help.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
 |
I would like to create a treecontrol to view all the .txt files on my computer.
|
|
|
|
|
|
 |
Okay, and your specific question is what?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
 |
Look at the links I gave you.
|
|
|
|