Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

strncat(3posix) [linux man page]

STRNCAT(P)						     POSIX Programmer's Manual							STRNCAT(P)

NAME
strncat - concatenate a string with part of another SYNOPSIS
#include <string.h> char *strncat(char *restrict s1, const char *restrict s2, size_t n); DESCRIPTION
The strncat() function shall append not more than n bytes (a null byte and bytes that follow it are not appended) from the array pointed to by s2 to the end of the string pointed to by s1. The initial byte of s2 overwrites the null byte at the end of s1. A terminating null byte is always appended to the result. If copying takes place between objects that overlap, the behavior is undefined. RETURN VALUE
The strncat() function shall return s1; no return value shall be reserved to indicate an error. ERRORS
No errors are defined. The following sections are informative. EXAMPLES
None. APPLICATION USAGE
None. RATIONALE
None. FUTURE DIRECTIONS
None. SEE ALSO
strcat() , the Base Definitions volume of IEEE Std 1003.1-2001, <string.h> COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1, 2003 Edition, Standard for Information Technol- ogy -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html . IEEE
/The Open Group 2003 STRNCAT(P)

Check Out this Related Man Page

STRNCAT(3P)						     POSIX Programmer's Manual						       STRNCAT(3P)

PROLOG
This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the correspond- ing Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux. NAME
strncat - concatenate a string with part of another SYNOPSIS
#include <string.h> char *strncat(char *restrict s1, const char *restrict s2, size_t n); DESCRIPTION
The strncat() function shall append not more than n bytes (a null byte and bytes that follow it are not appended) from the array pointed to by s2 to the end of the string pointed to by s1. The initial byte of s2 overwrites the null byte at the end of s1. A terminating null byte is always appended to the result. If copying takes place between objects that overlap, the behavior is undefined. RETURN VALUE
The strncat() function shall return s1; no return value shall be reserved to indicate an error. ERRORS
No errors are defined. The following sections are informative. EXAMPLES
None. APPLICATION USAGE
None. RATIONALE
None. FUTURE DIRECTIONS
None. SEE ALSO
strcat(), the Base Definitions volume of IEEE Std 1003.1-2001, <string.h> COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1, 2003 Edition, Standard for Information Technol- ogy -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html . IEEE
/The Open Group 2003 STRNCAT(3P)
Man Page

7 More Discussions You Might Find Interesting

1. Programming

Linux C - how to open a pdf file with default reader

sorry if i repost this... hi.. i want to ask how to open pdf files using C in Linux in Windows, i just use this code: ShellExecute(GetDesktopWindow(), "open", "D:\\Folder\\File.pdf", NULL, NULL, SW_SHOWNORMAL); thanks for advance... (3 Replies)
Discussion started by: sunardo
3 Replies

2. Programming

segmentation fault while using popen

hi, i am trying to use popen to run a grep process and check if the pattern exists in the file that i am searching in. i am getting segmentation fault when i try to execute the following code char *cd; char flag; char hdr_flpsp; char hdr_flpsp2; FILE *fp; printf ("program starts");... (1 Reply)
Discussion started by: sais
1 Replies

3. UNIX for Dummies Questions & Answers

Simple Problems to Solve!

Hi, I'm pretty poor at using UNIX but I'm learning. Please help me with these simple problems! Much appreciated! 1. I've changed my shell from bash to csh but I prefer bash. How do I change back? I've tried using chsh -s but it's not working! 2. I'm trying to download TopCat. I've done... (2 Replies)
Discussion started by: SimonWhite
2 Replies

4. Programming

Now i can't get FD_ISSET to work

I have this server I am making but it ignores an if statement which I have posted below so i want to ask If I could post main.c which compiles without errors for me and see if anyone could tell me why the code below doesn't trigger my function. I want to ask first because some forums don't... (7 Replies)
Discussion started by: Errigour
7 Replies

5. Programming

System Calls using C w/BASH

Hello all, I'm attempting to write a basic application that appends an arbitrary list of txt files to one txt file. So, for example, if the application is run like so: appendFileToFile file1.txt file2.txt file3.txt the system command should, hopefully be, cat >> testfile.txt I'm... (4 Replies)
Discussion started by: whyte_rhyno
4 Replies

6. Programming

Concatenating Struct Value With Char In C

After googling everything I could, the best I could do with this is get the following warning with -Wall: gcc -Wall help.c -o help help.c: In function ‘findpid': help.c:29:25: warning: passing argument 2 of ‘strncat' from incompatible pointer type strncat( pro, &str, 60); ... (5 Replies)
Discussion started by: Azrael
5 Replies

7. Programming

Wildcard Pattern Matching In C

I've been having problems lately trying to do pattern matching in C while implementing wildcards. Take for instance the following code: #include <sys/types.h> #include <sys/stat.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <dirent.h> #include <string.h> ... (14 Replies)
Discussion started by: Azrael
14 Replies