strcat
7-47
Run-Time-Support Functions
Square Root
sqrt
Syntax
#include <math.h>
double
sqrt
(double x);
Defined in
sqrt.c in rts.src
Description
The sqrt function returns the nonnegative square root of a real number x. A
domain error occurs if the argument is negative.
Example
double x, y;
x = 100.0;
y = sqrt(x);
/* return value = 10.0 */
srand
Concatenate Strings
strcat
Syntax
#include <string.h>
char *
strcat
(char *string1, char *string2);
Defined in
strcat.c in rts.src
Description
The strcat function appends a copy of string2 (including a terminating null
character) to the end of string1. The initial character of string2 overwrites the
null character that originally terminated string1. The function returns the value
of string1. The strcat function is expanded inline when the
−
x option is used
string1 must be large enough to contain the entire string.
Example
In the following example, the character strings pointed to by *a, *b, and *c are
assigned to point to the strings shown in the comments. In the comments, the
notation \0 represents the null character:
char *a, *b, *c;
.
.
.
/* a −−> ”The quick black fox\0”
*/
/* b −−> ”jumps over \0”
*/
/* c −−> ”the lazy dog.\0”
*/
strcat (a,b);
/* a −−> ”The quick black fox jumps over \0”
*/
strcat (a,c);
/* a −−> ”The quick black fox jumps over the lazy dog.\0”
*/
Summary of Contents for TMS320C2x
Page 8: ...viii...
Page 69: ...2 47 C Compiler Description...
Page 159: ...6 36...
Page 226: ...8 6...