puts(3s)puts(3s)Name
puts, fputs - put a string on a stream
Syntax
#include <stdio.h>
puts(s)
char *s;
fputs(s, stream)
char *s;
FILE *stream;
Description
The subroutine copies the null-terminated string s to the standard output stream stdout and appends a new line character.
The subroutine copies the null-terminated string s to the named output stream.
Neither routine copies the terminal null character.
Restrictions
The subroutine appends a new line, while does not.
See Alsofopen(3s), gets(3s), putc(3s), printf(3s), ferror(3s)fread(3s)puts(3s)
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.11 18 Jun 2003 puts(3C)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)