The effect of string functions is realized by other means, such as comparing array characters, displaying string lengths, copying strings, and so on. When comparing strings, the first is to compare the length of the string, when the length of the same time at different positions one by one corresponding character comparison size. With respect to the character length is the return value return count; The count represents the subscript at a different position on the array, and the IF (a[count]== ' s) stops the loop returning a return count when a position on the array is 0. Copying a string is done by looping through each bit on the array.
The UID course mainly explains the basic use of PS and the skill of shortcut keys. This main auxiliary page structure to build the approximate layout, first of all to imitate some of the more famous domestic sites, through a reasonable collocation design to achieve the personalization and practicality of the website.
int main ()
{
Char a[10] = "Hello";
Char b[] = "Hello";
void Stringcopy (char A[],char b[]);
void Stringconcat (char A[],char b[]);
int stringcmp (char A[],char b[]);
Stringcopy (A, b);
Stringconcat (A, b);
int re = stringcmp (A, b);
printf ("%d", re);
Puts (a);
}
Comparing strings
int stringcmp (char A[],char b[])
{
int i=0;
for (;; i++)
{
if (a[i]== ' &&b[i]== ')
{
return 0;
}
else if (a[i]== ' && b[i]!= ')
{
return-1;
}
else if (b[i]== ')
{
return 1;
}
if (a[i]-b[i]!=0)
{
return a[i]-b[i];
}
}
}
String length
int GetLength (char a[])
{
int count=0;
for (;;)
{
if (a[count]== ')
{
return count;
}
count++;
}
}
Copy string
void Stringcopy (char A[],char b[])
{
int i=0;
for (;; i++)
{
A[i]=b[i];
if (b[i]== ')
{
Break
}
}
}
Link
void Stringconcat (char A[],char b[])
{
/*
int i;
for (i=0;; i++)
{
if (a[i]== ')
{
Int J;
for (j=0;;)
{
a[i++] = b[j++];
if (b[j]== ')
{
Return
}
}
}
} */
int i;
for (i=0;; i++)
{
if (a[i]== ')
{
Break
}
}
int j=0;
for (;; J + +)
{
a[i++] = B[j];
if (b[j]== ')
{
Break
}
}
}
4.20-4.24 Programming Basics end, UID course