: : : : Hi, I'm trying to move the cursor (not mouse cursor) within the console window. As I understand I can use a function in conio.h called gotoxy(). I cant get this to work. Does anyone know how I can move the cursor so I can print text anyware in the console window I want.
: : : :
: : : : I would really like to print a menu of options and above that, I would like the user to enter their selection.
: : : :
: : : : And I DONT want to use MFC or anything that calls windows.h
: : : :
: : : : Right now, I'm using Dev-C++ 4 as a compiler.
: : : :
: : : : ~Eric
: : : :
: : :
: : : Well guess what, there is no way to do things like that in standard C/C++.
: : :
: : : You're working on Windows so there's nothing wrong with using windows.h and other windows specific header files to do your console manipulations.
: : :
: : : If you're trying to write a cross-platform program then you'll need to either use OS specific code for each platform's build or you'll need to use a cross-platform library that does what you need.
: : :
: : :
: : :
: : :
: : :
: : :
To understand recursive, first you need to understand recursive
: :
: : or you could work around wiht fancy macros
: :
: : #define a macro like changeCursor(x,y)
: : and make it a wrapper(is that correct terminology?)
: :
: :
: : #define changeCursor(x,y) \
: : winchangecur(x,y)
: :
: :
: : winchangecur is the real function(or macro, i dont think you need a function for that)
: :
: : then use only changeCursor in ur code, but as u port the program, write a new function and place it there in changeCursor's definition instead of winchangcur
: :
: : by the way, i would like to know how you do that using only the API, not MFC, non C++
: :
: : thanx you two
: : {2}rIng
: :
:
:
: Using macros to wrap OS specific code is the same as what I already mentioned when I said "use OS specific code for each platform's build"
:
:
: For Windows, look for SetConsoleCursorPosition()
:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/console_functions.asp
:
:
To understand recursive, first you need to understand recursive
:
:
Here is a good site with tutes on console windows:
http://www.adrianxw.dk/SoftwareSite/index.html