Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

fputs(3) [osx man page]

FPUTS(3)						   BSD Library Functions Manual 						  FPUTS(3)

NAME
fputs, puts -- output a line to a stream LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <stdio.h> int fputs(const char *restrict s, FILE *restrict stream); int puts(const char *s); DESCRIPTION
The function fputs() writes the string pointed to by s to the stream pointed to by stream. The function puts() writes the string s, and a terminating newline character, to the stream stdout. RETURN VALUES
The functions fputs() and puts() return a nonnegative integer on success and EOF on error. ERRORS
[EBADF] The stream argument is not a writable stream. The functions fputs() and puts() may also fail and set errno for any of the errors specified for the routines write(2). COMPATIBILITY
fputs() now returns a non-negative number (as opposed to 0) on successful completion. As a result, many tests (e.g., "fputs() == 0", "fputs() != 0") do not give the desired result. Use "fputs() != EOF" or "fputs() == EOF" to determine success or failure. SEE ALSO
ferror(3), fputws(3), putc(3), stdio(3) STANDARDS
The functions fputs() and puts() conform to ISO/IEC 9899:1990 (``ISO C90''). While not mentioned in the standard, both fputs() and puts() print '(null)' if str is NULL. BSD
June 4, 1993 BSD

Check Out this Related Man Page

puts(3C)						   Standard C Library Functions 						  puts(3C)

NAME
puts, fputs - put a string on a stream SYNOPSIS
#include <stdio.h> int puts(const char *s); int fputs(const char *s, FILE *stream); DESCRIPTION
The puts() function writes the string pointed to by s, followed by a NEWLINE character, to the standard output stream stdout (see intro(3)). The terminating null byte is not written. The fputs() function writes the null-terminated string pointed to by s to the named output stream. The terminating null byte is not writ- ten. The st_ctime and st_mtime fields of the file will be marked for update between the successful execution of fputs() and the next successful completion of a call to fflush(3C) or fclose(3C) on the same stream or a call to exit(2) or abort(3C). RETURN VALUES
On successful completion, both functions return the number of bytes written; otherwise they return EOF and set errno to indicate the error. ERRORS
Refer to fputc(3C). USAGE
Unlike puts(), the fputs() function does not write a NEWLINE character at the end of the string. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
exit(2), write(2), intro(3), abort(3C), fclose(3C), ferror(3C), fflush(3C), fopen(3C), fputc(3C), printf(3C), stdio(3C), attributes(5), standards(5) SunOS 5.10 18 Jun 2003 puts(3C)
Man Page

12 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sort a big data file

Hello, I have a big data file (160 MB) full of records with pipe(|) delimited those fields. I`m sorting the file on the first field. I'm trying to sort with "sort" command and it brings me 6 minutes. I have tried with some transformation methods in perl but it results "Out of memory". I was... (2 Replies)
Discussion started by: rubber08
2 Replies

2. Programming

Unexplained segmentation fault

Hi, The following code reads 20 characters from one file and writes them (appends them) to the other file. The code works in Turbo C++ on windows but it shows segmentation fault on Linux. I am using Ubuntu 10.10 and gcc compiler. Please tell me where I was wrong. #include<stdio.h> void... (6 Replies)
Discussion started by: haritha.gorijav
6 Replies

3. Shell Programming and Scripting

how to choose random columns

Hello! Can anybody suggest about the fastest way of extracting "n" random columns from a very large file (tab separated) having thousands of columns, where n can be any specified number. Thanks! (10 Replies)
Discussion started by: mira
10 Replies

4. Programming

Print specific pattern line in c++

Input file: @HWI-BRUNOP1_header_1 GACCAATAAGTGATGATTGAATCGCGAGTGCTCGGCAGATTGCGATAAAC +HWI-BRUNOP1_header_1 TNTTJTTTETceJSP__VRJea`_NfcefbWe Desired output file: >HWI-BRUNOP1_header_1 GACCAATAAGTGATGATTGAATCGCGAGTGCTCGGCAGATTGCGATAAAC >HWI-BRUNOP1_header_2... (10 Replies)
Discussion started by: cpp_beginner
10 Replies

5. UNIX for Advanced & Expert Users

nth date

Hi I need to get the date of 50th day from the last friday for one of the calculation into variable in Unix script. The format required is YYYYMMDD. I have solaris OS and dont have GNU date. I would appreciate if some one can help me with this. It can be a onliner or function or block of code. ... (7 Replies)
Discussion started by: lijjumathew
7 Replies

6. Programming

C++ Input File line by line

Hi there, I need to read some data from a file with string and number that is similar to this: word1 0.0 1.0 0.0 word3 word4 0.0 0.0 -1.0 word1 0.0 0.0 1.0 word5With this code: #include<iostream> #include<fstream> #include<string> using namespace std; int main() ... (5 Replies)
Discussion started by: Giordano Bruno
5 Replies

7. Programming

Raw Socket Programming - Efficient Packet Sniffer

Hi, I have the requirement to sniff packets from the Ethernet card on my Linux machine and process it and feed it to a RANAP protocol stack. So far I have written the raw packet sniffer and successfully sniffing packets and do little processing. However, for huge number of packets ... (9 Replies)
Discussion started by: rstnsrr
9 Replies

8. Programming

C++ getline, parse and take first tokens by condition

Hello, Trying to parse a file (in FASTA format) and reformat it. 1) Each record starts with ">" and followed by words separated by space, but they are in one same line for sure; 2) Sequences are following that may be in multiple rows with possible spaces inside until the next ">".... (18 Replies)
Discussion started by: yifangt
18 Replies

9. IP Networking

A Basic example of socket programming in C

Hello, I have a question about socket programming The question was a homework of this university of past (2011?) course. The server is simulating a sensor that provides readings of temperature, light and humidity (temp.dat, light.dat, humid.dat) each with single column of number, one per row. ... (6 Replies)
Discussion started by: yifangt
6 Replies

10. 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

11. UNIX for Beginners Questions & Answers

Ncurses status bar

Hi, all, I'm writing a BBS telnet client, and am trying to implement a status bar into it, at the bottom of the screen. I am using NCurses to accomplish this. So far, it appears to be working, that is, upon connecting to BBS, it will display the status bar, and then quickly disappear. ... (5 Replies)
Discussion started by: ignatius
5 Replies

12. UNIX for Beginners Questions & Answers

Change text font to greater one in this very good MOTIF texteditor ?

Hi, i have here found a very good texteditor source code programmed in the MOTIF GUI language. For myself i need NOTHING else to program. To start from a very easy point of view i want to RUN this editor on my LINUX machine and type simple C code. The reason for this post is that the text... (7 Replies)
Discussion started by: Sennenmut
7 Replies