Wie ist "strcat()" Funktion in C programmiert?
Geizhals » Forum » Programmierung » Wie ist "strcat()" Funktion in C programmiert? (8 Beiträge, 18 Mal gelesen) Top-100 | Fresh-100
Du bist nicht angemeldet. [ Login/Registrieren ]
.
Re: Wie ist "strcat()" Funktion in C programmiert?
14.04.2002, 19:13:32
strcat, wcscat, _mbscat
Append a string.

char *strcat( char *strDestination, const char *strSource );

wchar_t *wcscat( wchar_t *strDestination, const wchar_t *strSource );

unsigned char *_mbscat( unsigned char *strDestination, const unsigned char *strSource );

Routine Required Header Compatibility
strcat ANSI, Win 95, Win NT
wcscat or ANSI, Win 95, Win NT
_mbscat Win 95, Win NT


For additional compatibility information, see Compatibility in the Introduction.

Libraries

LIBC.LIB Single thread static library, retail version
LIBCMT.LIB Multithread static library, retail version
MSVCRT.LIB Import library for MSVCRT.DLL, retail version


Return Value

Each of these functions returns the destination string (strDestination). No return value is reserved to indicate an error.

Parameters

strDestination

Null-terminated destination string

strSource

Null-terminated source string

Remarks

The strcat function appends strSource to strDestination and terminates the resulting string with a null character. The initial character of strSource overwrites the terminating null character of strDestination. No overflow checking is performed when strings are copied or appended. The behavior of strcat is undefined if the source and destination strings overlap.

wcscat and _mbscat are wide-character and multibyte-character versions of strcat. The arguments and return value of wcscat are wide-character strings; those of _mbscat are multibyte-character strings. These three functions behave identically otherwise.

Generic-Text Routine Mappings

TCHAR.H Routine  _UNICODE & _MBCS Not Defined _MBCS Defined _UNICODE Defined
_tcscat strcat _mbscat wcscat


Example

/* STRCPY.C: This program uses strcpy
* and strcat to build a phrase.
*/

#include
#include

void main( void )
{
   char string[80];
   strcpy( string, "Hello world from " );
   strcat( string, "strcpy " );
   strcat( string, "and " );
   strcat( string, "strcat!" );
   printf( "String = %s\n", string );
}


Output

String = Hello world from strcpy and strcat!


String Manipulation Routines

See Also   strncat, strncmp, strncpy, _strnicmp, strrchr, strspn


Antworten PM Übersicht Chronologisch Zum Vorgänger
 
Melden nicht möglich
 

Dieses Forum ist eine frei zugängliche Diskussionsplattform.
Der Betreiber übernimmt keine Verantwortung für den Inhalt der Beiträge und behält sich das Recht vor, Beiträge mit rechtswidrigem oder anstößigem Inhalt zu löschen.
Datenschutzerklärung