Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

fputs(3s) [bsd man page]

PUTS(3S)																  PUTS(3S)

puts, fputs - put a string on a stream SYNOPSIS
#include <stdio.h> puts(s) char *s; fputs(s, stream) char *s; FILE *stream; DESCRIPTION
Puts copies the null-terminated string s to the standard output stream stdout and appends a newline character. Fputs copies the null-terminated string s to the named output stream. Neither routine copies the terminal null character. SEE ALSO
fopen(3S), gets(3S), putc(3S), printf(3S), ferror(3S) fread(3S) for fwrite BUGS
Puts appends a newline, fputs does not, all in the name of backward compatibility. 7th Edition May 15, 1985 PUTS(3S)

Check Out this Related Man Page

PUTS(3) 						     Linux Programmer's Manual							   PUTS(3)

fputc, fputs, putc, putchar, puts - output of characters and strings SYNOPSIS
#include <stdio.h> int fputc(int c, FILE *stream); int fputs(const char *s, FILE *stream); int putc(int c, FILE *stream); int putchar(int c); int puts(const char *s); DESCRIPTION
fputc() writes the character c, cast to an unsigned char, to stream. fputs() writes the string s to stream, without its trailing ''. putc() is equivalent to fputc() except that it may be implemented as a macro which evaluates stream more than once. putchar(c); is equivalent to putc(c,stdout). puts() writes the string s and a trailing newline to stdout. Calls to the functions described here can be mixed with each other and with calls to other output functions from the stdio library for the same output stream. For non-locking counterparts, see unlocked_stdio(3). RETURN VALUE
fputc(), putc() and putchar() return the character written as an unsigned char cast to an int or EOF on error. puts() and fputs() return a non-negative number on success, or EOF on error. CONFORMING TO
It is not advisable to mix calls to output functions from the stdio library with low - level calls to write() for the file descriptor asso- ciated with the same output stream; the results will be undefined and very probably not what you want. SEE ALSO
write(2), ferror(3), fopen(3), fseek(3), fwrite(3), gets(3), scanf(3), unlocked_stdio(3) GNU
1993-04-04 PUTS(3)
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++

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