c - How to copy content of a line into string by giving line's coordinates -
i want know if there way copy content of line console window string. example
#include <stdio.h> #include <stdlib.h> #include <conio.h> int main() { char a[10];int b; int x1,y1,x2,y2,x3,y3; x1=wherex(); y1=wherey(); printf("enter name : "); scanf("%s",&a); x2=wherex(); y3=wherey(); printf("enter age : "); scanf("%d",&b); x3=wherex(); y3=wherey(); printf("enter gender : "); scanf("%d",&a); char copyline1[80];char copyline2[80];char copyline3[80]; gotoxy(x1,y1); copyline1[]= ??? // copy content of line 1 copyline1[] gotoxy(x2,y2); copyline2[]= ??? // copy content of line 2 copyline2[] gotoxy(x3,y3); copyline3[]= ??? // copy content of line 3 copyline3[] printf(" first line is\n"); puts(copyline1); // print enter name : abc printf(" second line is\n"); puts(copyline2); // print content of line 2 of console window printf(" third line \n"); puts(copyline3); return 0; }
i want copy content of line string giving line's coordinates , if possible !
char buf[70]; coord coord = {x-coordinate,y-coordinate}; dword num_read; handle hconsole = getstdhandle(std_output_handle); readconsoleoutputcharacter(hconsole,(lptstr) buf,(dword) 70,coord,(lpdword) &num_read); buf[69]='\0';
content of line copied char buf.
Comments
Post a Comment