/*! Brief copies the last part of the string.
Compile the strmcpy (S, T, m) function, and copy all the characters starting from the M character to the string S. N
Difficulty coefficient: simple
Param [in] source string. Read-Only
Param [in] DEST destination string
Param [in] nstart starts from nstart
Bug
-# Strlen (source) <nstart is not taken into account. (error)
-# Dest [] insufficient space is not taken into account. (error)
-# The source does not end with '/0'. (error)
.
Pre source is zero Ending & strlen (source)> nstart & sizeof (DEST)> sizeof (source)
Post DEST is zero Ending & strcmp (DEST, source + nstart) = 0
*/
Void leftsubstr (char * Source, char * DEST, int nstart)
{
Char * P = source + nstart;
Char * q = DEST;
While (* q ++ = * P ++ );
}
// 4. write a function, input a string containing numbers and non-numeric characters, and take its continuous numbers as an integer, store them in array a in sequence, and count the number of integers.
// If the database is not used:
Int isdigit (int c)
{
Return! (C <'0' | C> '9 ');
}
Int atoi (char * Str)
{
Char * P = STR;
Int sum = * P-'0 ';
While (isdigit (* ++ p ))
{
Sum = sum * 10 + (* P-'0 ');
}
Return sum;
}
Int finddigital (char * STR, int Buf [], int nlen)
{
Char * P = STR;
Int I;
For (I = 0; I <nlen & * P; I ++)
{
While (* P &&! Isdigit (* ++ p ));
Buf [I] = atoi (P );
While (isdigit (* ++ p ));
}
Return I;
}
# Include <stdio. h>
Int main ()
{
Int A [10];
Int Len = finddigital ("-11,2", A, 10 );
Printf ("% d, % d, % d", Len, a [0], a [1]);
Return 0;
}