putc(3s)putc(3s)Name
putc, putchar, fputc, putw - put character or word on a stream
Syntax
#include <stdio.h>
int putc(c, stream)
char c;
FILE *stream;
putchar(c)
fputc(c, stream)
FILE *stream
putw(w, stream)
FILE *stream;
Description
The routine appends the character c to the named output stream. It returns the character written.
The routine is defined as (c, stdout).
The routine behaves like but is a genuine function rather than a macro.
The routine appends word (that is, int) w to the output stream. It returns zero. The routine neither assumes nor causes special alignment
in the file.
Restrictions
Because it is implemented as a macro, treats a stream argument with side effects incorrectly. In particular, `putc(c, *f++);' doesn't work
as expected.
Diagnostics
The and functions return the constant EOF upon error. The function returns a non-zero value on error.
See Alsofclose(3s), fopen(3s), fread(3s), getc(3s), printf(3s), puts(3s)putc(3s)
Check Out this Related Man Page
PUTC(3S)PUTC(3S)NAME
putc, putchar, fputc, putw - put character or word on a stream
SYNOPSIS
#include <stdio.h>
int putc(c, stream)
char c;
FILE *stream;
int putchar(c)
int fputc(c, stream)
FILE *stream;
int putw(w, stream)
FILE *stream;
DESCRIPTION
Putc appends the character c to the named output stream. It returns the character written.
Putchar(c) is defined as putc(c, stdout).
Fputc behaves like putc, but is a genuine function rather than a macro.
Putw appends word (that is, int) w to the output stream. It returns the word written. Putw neither assumes nor causes special alignment
in the file.
SEE ALSO fopen(3S), fclose(3S), getc(3S), puts(3S), printf(3S), fread(3S)DIAGNOSTICS
These functions return the constant EOF upon error. Since this is a good integer, ferror(3S) should be used to detect putw errors.
BUGS
Because it is implemented as a macro, putc treats a stream argument with side effects improperly. In particular
putc(c, *f++);
doesn't work sensibly.
Errors can occur long after the call to putc.
7th Edition November 6, 1985 PUTC(3S)
I want my program to replace tabs with spaces.1tab=4spaces.When i write aa(tab)aaa(tab)(tab)a(tab) it must show me aaxxaaaxxxxxaxxx. I think that my program works corectly but when a write aaa(tab)a it must show aaaxa but it is aaaxxxxxa.Please for help!!! That is my code:
#include <stdio.h>
... (3 Replies)
I am looking to create some ksh93 extensions using the custom builtin feature.
I can successfully create a builtin function, load it using the builtin -f command and get an output. However, I want to get/set values of KSH variables from within my built-in.
For example, lets say I am creating... (2 Replies)
Hello fellow programmers!:)
First of all excuse me for my English, i am from abroad...
I am trying to learn the C++ programming language as it is one of the most basic languages.So,instead of just creating small examples for each feature(like class,input/output etc), I decided to create a mini... (6 Replies)
Hi guys,
For my wiki site I need to fix 1400 pages that use the wrong date format, most pages (not all) use eg. 1988]] I need to change that to (1988)]]
The date range goes back to 1400 so I guess I need to do the following
ssh into my server,
dump mysql database
vi .sql dump
search... (20 Replies)
Hi,
There are three type of buffering: Fully buffered,line buffered,and unbuffered. The goal of the buffering provided by the standard I/O library is to use the minimum number of read and write calls.
I understand that decrease write() calls when use output function output data to a file ,... (4 Replies)
Hi! I've got a problem with reading from serial port, when I run this code on Digi ConnectCore Wi-9c. But writing to serial port is Ok. By the way, when I'm running this code on "full" Linux it is working Ok - I can read and write to serial without mistakes. Where is a problem?
uname -a:... (3 Replies)
Can any one help me out with following problem...
I want to search in a file which has two strings repeat each time(like start and end) i want to search between these two string in C programming.
please help me with the solution.
thanks in advance. (8 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 posted on here a while ago about processing multiple files within a script.
See original post below:
I have a program cfxfrwb which is designed to remove headers from reports files.
The cfxfrwb is located in the following directory /u01/efin/v40/live/bin
I run the program against... (8 Replies)
Have difficulty to understand this pure C code to only print vowels twice from input string. Questions are commented at the end of each place.
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <limits.h>
/*
*Demonstrate the use of dispatch tables
*/
/*Print a char... (11 Replies)
I'm looking for a way to inventory files on a webserver into a CSV file, and am particularly interested in certain types of files, like .php, .cgi, .pl, .py, .sh, etc. but also want the ability to find all files, including those with no extension, or specified extensions, as above, including files... (1 Reply)
I have two CSV files file1, file2 as below
File 1:
Key, Value1, Value2, Value3, Value4,......value
A,50,100,50,40,....,100
File 2:
Key, value1,Value2,Value3,Value 4 so on...
A,50,80,45,50.....
Now, I want to check if key from file 1 is present in file 2 or not if present I want to... (9 Replies)