-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathglobalf.cpp
More file actions
executable file
·56 lines (52 loc) · 1.1 KB
/
globalf.cpp
File metadata and controls
executable file
·56 lines (52 loc) · 1.1 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
#include"all.hpp"
int debugKeyStart=0 ;
extern outputRexx out1;
//extern ofstream outDebugError;
void myDebugKey(long int a11 , char *pp1)
{
if(pp1) cout<<pp1<<" ";
cout<<a11<<endl ;
char ch3 = getch();
if(ch3 == 27)
exitProgram(1);
}
void exitProgram(int i1)
{
//outDebugError.close();
fcloseall();cout<<"end program"<<endl;exit(i1); }
// same as " strchr " but in locate return the location of characterSearch
char *ahmadStrchr(char *s1,char characterSearch,int &locateCharacter)
{
register int i1=0;
for(;*s1;i1++,s1++)
if(*s1== characterSearch)
break;
if(*s1==NULL) s1=NULL;
locateCharacter=i1;
return s1;
}
int ahmadStrcmp(char *s1,char *s2)
{
register int i1=0,i2=0;
for(;(*s1) && (*s1== ' ');s1++,i1++);
for(;(*s2) && (*s2== ' ');s2++);
for(; *s1 && *s2; s1++,s2++,i1++)
if( *s1<*s2)
{i2= -i1; break;}
else if( *s1>*s2)
{i2= i1;break;}
if(!i2)
if(*s1)
{
for(;(*s1) && (*s1== ' ');s1++,i1++);
if(*s1)
i2=i1;
}
else if(*s2)
{
for(;(*s2) && (*s2== ' ');s2++);
if(*s2)
i2=-i1;
}
return i2;
}