This shows you the differences between two versions of the page.
c:conio.h:gotoxy [2015/07/22 12:43] 112.203.138.3 [description of gotoxy] |
c:conio.h:gotoxy [2024/02/16 01:05] (current) |
||
---|---|---|---|
Line 10: | Line 10: | ||
<code c> | <code c> | ||
#include<stdio.h> | #include<stdio.h> | ||
- | main() | + | #include<conio.h> |
+ | |||
+ | int main( void ) | ||
{ | { | ||
- | clrscr; | + | int x, y; |
- | gotoxy("1,1"); | + | x = 42; |
- | printf(" |mmh |mmd hmm+ `mmm +mmmmy"); | + | y = 42; |
- | gotoxy("1,2"); | + | clrscr(); |
- | printf("+MMm +MMN dMM+ `MMM dMNMMN`"); | + | gotoxy(x, y); |
- | gotoxy("1,3"); | + | |
- | printf("+MMm +MMN dMM+ `MMM .MMydMM|"); | + | |
- | gotoxy("1,4"); | + | |
- | printf("+MMm```+MMN dMM+ `MMM oMM|+MMh"); | + | |
- | gotoxy("1,5"); | + | |
- | printf("+MMMdddmMMN dMM+ `MMM mMN`.MMM`"); | + | |
- | gotoxy("1,6"); | + | |
- | printf("+MMNooohMMN dMM+ `MMM -MMh dMM+"); | + | |
- | gotoxy("1,7"); | + | |
- | printf("+MMm +MMN dMM+ `MMM sMMy++hMMd"); | + | |
- | gotoxy("1,8"); | + | |
- | printf("+MMm +MMN dMMo .MMN mMMNNNNMMM."); | + | |
- | gotoxy("1,9"); | + | |
- | printf("+MMm +MMN |NMNyymMMs -MMh dMM+"); | + | |
- | gotoxy("1,10"); | + | |
- | printf(":yys :yys -oyhdhs: |yy: |yy+"); | + | |
- | getch; | + | |
- | } | + | |
+ | printf("gotoxy jumps to cursor position x42 y42."); | ||
+ | getch(); | ||
+ | return 0; | ||
+ | } | ||
</code> | </code> | ||
===== output of gotoxy c example ===== | ===== output of gotoxy c example ===== | ||
{{:c:conio.h:gotoxy.png?nolink|gotoxy example output in cmd}} | {{:c:conio.h:gotoxy.png?nolink|gotoxy example output in cmd}} |