move cursor

I wanna move my cursor to mid, but my lecturer not allow me to using "\t"
pliss help me, I's still newbie in programming.
I use I use microsoft visual c++ 2008 express edition
not sure what your asking for, do you mean centering text?
acctually I wanna ask the alternate function for goto(x,y) in microsoft visual c++ 2008 express edition ?
forgive me, because my english not to good
sorry i dont use goto() of any kind. hope someone else can help, good luck
it's okay.
I hope there someone answer me, thanks kyle
If you're talking about the console cursor, there's no standard way to do it.

You'll either have to get into platform specific things, or you'll have to use additional libs.


Though generally console programs should not move the cursor and you should rethink whatever it is you're trying to do.
thank's for the info disch, but how about exit ? is it there ?
I remember in university course I have to line up my sentences. There is a way to do it. I just can't remember how. It was a first year course so it couldn't have been that hard.

set space (7) or somthing like that meant "hit the space bar 7 times". It may require another library but I know it can be done because I use to do it on every assignment to make it look nice.

Keep searching, try looking up Character space, indentation, lining up output or somthing.
Ok found it.

You have to include name space std;

and then write
 
cout<<setw(10)<<"ten"<<"four"<<"four";


This will add 10 spaces after the word ten.
I made a function for practice where you can select the location of the text a week or so ago, here it is:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
void PrinText (char cText [], int X, int Y)
{
       using namespace std;
       for (int iLoopCounter = 0; iLoopCounter < Y; iLoopCounter++)
       {
              cout << endl;
       }
       for (int iLoopCounter = 0; iLoopCounter < X; iLoopCounter++)
       {
              cout << " ";
       }
       cout << cText;
       return;
}


Just call the function with the parameters you want:

(Text, X Axis, Y Axis)

And it will print out the text for you. You can use the same idea to move your text cursor to the location you want to. I'm sure there are better ways, but this is how I would do it.
Topic archived. No new replies allowed.