-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunc.cpp
More file actions
62 lines (56 loc) · 1.14 KB
/
func.cpp
File metadata and controls
62 lines (56 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#include "func.h"
int cek(string a, string b)
{
return a.compare(b)<=0;
/* maafkan daku
int n;
char *x, *y;
// x = new char[a.length()+1];
// x = a;
// y = new char[b.length()+1];
// y = b;
if (a.length() > b.length()) n = b.length();
else n = a.length();
for (int i = 0; i < n; i++)
{
if(a[i] == b[i])continue;
else if(a[i] < b[i]) return 1;
else return 0;
}
return 1;
// return a.compare() < b ? 1:0;
*/
}
void put(string x)
{
FILE * file;
file = fopen("data.exe", "a+");
// if(file.is_open()) cout << "Open.";
// else cout << "UnOpened.";
fseek(file, 0, SEEK_END);
fprintf(file, "%s\n", x.c_str());
fclose(file);
}
void gotoxy(int column, int line)
{
COORD coord;
coord.X = column;
coord.Y = line;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),coord);
}
int wherex()
{
CONSOLE_SCREEN_BUFFER_INFO csbi;
COORD result;
if (!GetConsoleScreenBufferInfo(GetStdHandle( STD_OUTPUT_HANDLE ),&csbi))
return -1;
return result.X;
}
int wherey()
{
CONSOLE_SCREEN_BUFFER_INFO csbi;
COORD result;
if (!GetConsoleScreenBufferInfo(GetStdHandle( STD_OUTPUT_HANDLE ),&csbi))
return -1;
return result.Y;
}