Strcat

Strcat

In computing, the C programming language offers a library function called strcat that allows one memory block to be appended to another memory block. Both memory blocks are required to be null-terminated. Since, in C, strings are not first-class datatypes, and are implemented as blocks of ASCII bytes in memory, strcat will effectively append one string to another given two pointers to blocks of allocated memory. The name strcat is an abbreviation of "string concatenate". strcat is found in the string.h header file.

For example:char str1 [100] = "Hello,"; /* 100: reserve extra space */strcat(str1, " world!");puts(str1); /* prints "Hello, world!" to stdout followed by a newline */Here is a possible implementation of strcat:

char *strcat(char *dest, const char *src){ size_t dest_len = strlen(dest); size_t i;

for (i = 0 ; src [i] != '


Wikimedia Foundation. 2010.

Игры ⚽ Нужна курсовая?

Look at other dictionaries:

  • Strcat — Saltar a navegación, búsqueda En computación el lenguaje de programación C ofrece una llamada en la biblioteca estándar de C denominada strcat. Esta permite añadir un bloque de memoria a otro. Los dos bloques deben terminar con un carácter nulo.… …   Wikipedia Español

  • strcat — En computación el lenguaje de programación C ofrece una llamada en la biblioteca estándar de C denominada strcat. Esta permite añadir un bloque de memoria a otro. Los dos bloques deben terminar con un carácter nulo. Como en C las cadenas de… …   Wikipedia Español

  • Schlemiel the painter's Algorithm — In software development, a Schlemiel the Painter [ s] algorithm denotes any methodology that is inefficient because the programmer has overlooked some fundamental issues at the very lowest levels of software design. The term was coined by… …   Wikipedia

  • Boilerplate (text) — Boilerplate is any text that is or can be reused in new contexts or applications without being changed much from the original. Many computer programmers often use the term boilerplate code. A legal boilerplate is a standard provision in a… …   Wikipedia

  • Backgrounder — Die Artikel Abbinder und Boilerplate überschneiden sich thematisch. Hilf mit, die Artikel besser voneinander abzugrenzen oder zu vereinigen. Beteilige dich dazu an der Diskussion über diese Überschneidungen. Bitte entferne diesen Baustein erst… …   Deutsch Wikipedia

  • Boilerplate — ((auch: Abbinder) oder engl. ursprl. Kesselplatte, Kochplatte, übertragen Standardtext, Textbaustein) bezeichnet einen gleichbleibenden Textblock meist am Ende eines Texts. Im Zusammenhang mit E Mails wird der Begriff auch im Zusammenhang mit der …   Deutsch Wikipedia

  • Symbolkette — Eine Zeichenkette oder ein String (englisch) ist eine Folge von Zeichen (z. B. Buchstaben, Ziffern, Sonderzeichen und Steuerzeichen) aus einem definierten Zeichensatz. Zeichen können sich in einer Zeichenkette wiederholen, die Reihenfolge der… …   Deutsch Wikipedia

  • Zeichenkette — Eine Zeichenkette oder (aus dem Englischen) ein String ist in der Informatik eine Folge von Zeichen (z. B. Buchstaben, Ziffern, Sonderzeichen und Steuerzeichen) aus einem definierten Zeichensatz. Zeichen können sich in einer Zeichenkette… …   Deutsch Wikipedia

  • C string handling — C string redirects here. For the underwear and swimwear, see C string (clothing). C Standard Library Data types Character classification Strings Mathematics …   Wikipedia

  • AutoLISP — is a dialect of Lisp programming language built specifically for use with the full version of AutoCAD and its derivatives, which include Autodesk Map 3D and Autodesk Architectural Desktop . Neither the application programming interface nor the… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”