Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

strcpy(9r) [osf1 man page]

strcpy(9r)																strcpy(9r)

NAME
strcpy - General: Copies a null-terminated character string SYNOPSIS
char * strcpy( char *s1, char *s2 ); ARGUMENTS
Specifies a pointer to a buffer large enough to hold the string s2. Specifies a pointer to a string (an array of characters terminated by a null character). DESCRIPTION
The strcpy routine copies string s2 to buffer s1. The routine stops copying after it copies a null character. Note that the character size is 1 byte. RETURN VALUES
The routine returns a pointer to the location following the end of the destination buffer, s1. SEE ALSO
Routines: bcopy(9r), blkclr(9r), copystr(9r), ovbcopy(9r), strncpy(9r) strcpy(9r)

Check Out this Related Man Page

bcopy(9r)																 bcopy(9r)

NAME
bcopy - General: Copies a series of bytes with a specified limit SYNOPSIS
void bcopy( char *b1, char *b2, int n ); ARGUMENTS
Specifies a pointer to a byte string (array of characters). This pointer can reside in kernel address space or in user address space. Specifies a pointer to a buffer of at least n bytes. This pointer can reside in kernel address space or in user address space. Specifies the number of bytes to be copied. DESCRIPTION
The bcopy routine copies n bytes from string b1 to buffer b2. No check is made for null bytes. The copy is nondestructive, that is, the address ranges of b1 and b2 can overlap. RETURN VALUES
None EXAMPLES
The following code fragment shows a call to bcopy: . . . struct tc_slot tc_slot[TC_IOSLOTS]; . . . char *cp; . . . bcopy(tc_slot[index].modulename, cp, TC_ROMNAMLEN + 1); . . . SEE ALSO
Routines: blkclr(9r), copystr(9r), ovbcopy(9r), strcpy(9r), strncpy(9r) bcopy(9r)
Man Page

8 More Discussions You Might Find Interesting

1. Programming

multiuser chat server closes when one client closes. code included

I have been trying to write a very basic chat program but at the moment I am having problems getting it to be multiuser as it closes all connections when one client shutsdown. I have also been having problems trying to get the program to display a list of usernames to the clients. I have tried... (0 Replies)
Discussion started by: dooker
0 Replies

2. Programming

Merge two strings by overlapped region

Hello, I am trying to concatenate two strings by merging the overlapped region. E.g. Seq1=ACGTGCCC Seq2=CCCCCGTGTGTGT Seq_merged=ACGTGCCCCCGTGTGTGTFunction strcat(char *dest, char *src) appends the src string to the dest string, ignoring the overlapped parts (prefix of src and suffix of dest).... (30 Replies)
Discussion started by: yifangt
30 Replies

3. Programming

Segfault When Parsing Delimiters In C

Another project, another bump in the road and another chance to learn. I've been trying to open gzipped files and parse data from them and hit a snag. I have data in gzips with a place followed by an ip or ip range sort of like this: Some place:x.x.x.x-x.x.x.x I was able to modify some code... (6 Replies)
Discussion started by: Azrael
6 Replies

4. Programming

Newline in ANSI-C standard functions

Can someone outline the "best practice" (if any!) to handle newline in ANSI-C standard library functions? I had some confusion with these functions recently related to char array and char pointer. puts(), printf(), strcpy(), strncpy(), memset(). I seem to understand their basic use, but got... (6 Replies)
Discussion started by: yifangt
6 Replies

5. Programming

Pipe usage error while visiting directories

To begin with FYI, I really struggled with the question before asking to simplify as much as I can around 1 hour and to increase the code's readability I neglect error checks. I intend to communicate parent and child using PIPE. In the following program I do traverse given path and its... (2 Replies)
Discussion started by: beginnerboy
2 Replies

6. UNIX for Beginners Questions & Answers

Adding to an array in an external file, and adding elements to it.

I have an array in an external file, "array.txt", which contains: char *testarray={"Zero", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine"};I want to be able to add an element to this array, and have that element display, whenever I call it, without having to recompile... (29 Replies)
Discussion started by: ignatius
29 Replies

7. Shell Programming and Scripting

Parsing syslog from Linux

Hello, I'm facing problem to extract fields from below syslog : logver=56 idseq=63256900099118326 itime=1563205190 devid=FG-5KDTB18800138 devname=LAL-C1-FGT-03 vd=USER date=2019-07-15 time=18:39:49 logid="0000000013" type="traffic" subtype="forward" level="notice" eventtime=1563205189... (17 Replies)
Discussion started by: arm
17 Replies

8. Programming

Format specifier for sscanf() in C

Hello, I have formatted lines delimited by colon ":", and I need to parse the line into two parts with sscanf() with format specifiers. infile.txt: Sample Name: sample1 SNPs : 91 MNPs : 1 Insertions : 5 Deletions ... (13 Replies)
Discussion started by: yifangt
13 Replies