| | |
Towers of Hanoi
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Nov 2004
Posts: 8
Reputation:
Solved Threads: 0
ok im trying to make the towers of hanoi program but i get the following compile error: [Linker error] undefined referrence to 'WinMain@16'
Heres the code, thanks for any help
Heres the code, thanks for any help
C++ Syntax (Toggle Plain Text)
#include <iostream> #include <cstdlib> using namespace std; void towers (int numDisks, char source, char dest, char auxiliary) { static int step = 0; cout << "Towers (" << numDisks << ", " << source << ", " << dest << ", " << auxiliary << ")\n"; if (numDisks == 1) cout << "\t\t\t\t\tStep " << ++step << ": Move from " << source << " to " << dest << endl; else { towers (numDisks - 1, source, auxiliary, dest); cout << "\t\t\t\t\tStep " << ++step << ": Move from " << source << " to " << dest << endl; towers (numDisks - 1, auxiliary, dest, source); } return; }
Last edited by alc6379; Nov 4th, 2004 at 11:32 pm. Reason: added [code] tags
![]() |
Similar Threads
- Towers of Hanoi (C++)
- Towers of Hanoi Recursive (C++)
- Towers of Hanoi (Computer Science)
- Solving Towers of Hanoi (C++)
- Towers of hanoi (VB.NET)
Other Threads in the C++ Forum
- Previous Thread: Can someone tell me what wrong with this program it doesn't run
- Next Thread: Looking for _gcvt(double,int,string)
| Thread Tools | Search this Thread |
api array based beginner binary c++ c/c++ calculator char char* class classes code compile compiler console conversion count delete deploy desktop directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux list loop looping loops map math matrix memory news node numbertoword output parameter pointer problem program programming project python random read recursion recursive reference return rpg sorting string strings struct temperature template templates test text text-file tree unix url variable vector video visualstudio win32 windows winsock word wordfrequency wxwidgets






