UNGETC(3S)UNGETC(3S)NAME
ungetc - push character back into input stream
SYNOPSIS
#include <stdio.h>
ungetc(c, stream)
FILE *stream;
DESCRIPTION
Ungetc pushes the character c back on an input stream. That character will be returned by the next getc call on that stream. Ungetc
returns c.
One character of pushback is guaranteed provided something has been read from the stream and the stream is actually buffered. Attempts to
push EOF are rejected.
Fseek(3) erases all memory of pushed back characters.
SEE ALSO getc(3), setbuf(3), fseek(3)DIAGNOSTICS
Ungetc returns EOF if it can't push a character back.
UNGETC(3S)
Check Out this Related Man Page
ungetc(3S)ungetc(3S)NAME
ungetc() - push character back into input stream
SYNOPSIS
Obsolescent Interface
DESCRIPTION
inserts the character c (converted to an unsigned char) into the buffer associated with an input stream. That character, c, is returned by
the next call to (see getc(3S)) on that stream. A successful intervening call to a file positioning function with stream or erases all
memory of the inserted characters.
affects only the buffer associated with the input stream. It does not affect the contents of the file corresponding to stream.
One character of pushback is guaranteed.
If c equals EOF, does nothing to the buffer and returns EOF.
Obsolescent Interface
pushes character back into input stream.
APPLICATION USAGE
After is applied to a stream, the stream becomes byte-oriented (see orientation(5)).
RETURN VALUE
If successful, and return c and clear the end-of-file indicator for the stream. and return EOF if they cannot insert the character.
WARNINGS
is an obsolescent interface supported only for compatibility with existing DCE applications. New multithreaded applications should use
SEE ALSO flockfile(3S), fseek(3S), fgetpos(3S), getc(3S), setbuf(3S), orientation(5), thread_safety(5).
STANDARDS CONFORMANCE ungetc(3S)
Can anyone help me?????
My problem is that i want to read only one charcter from keyboard. Each time my program waits to press enter or ^d. I don't want that. As soon as i press a charcter it should proceed to next statement in program without pressing enter or ^d.
please help... (3 Replies)
Hi Friends,
When Iam running c program in redhat linux 7.3 version and PCQ Linux 8.0 version, its taking around 20 seconds. But when Iam running it in HP-UX Release 11i, its taking around 3 minutes. Can anyone throw light on this.
Thanks in advance,
Praveen. (11 Replies)
I'm trying to write a program that will open an existing file supplied by the command line argument and then replace words with "We" or "we" by "I" and "a" or "A" by "The". When I run the program it reads the file, changes the word but re writes it on a new line with only the replaced words not the... (1 Reply)
I am trying to work this little program, its not working..
int main()
{
FILE *fp;
char *args;
pid_t child, exited_pid;
int status = 0;
*args = "less";
fp = popen("ls", "r");
child =... (4 Replies)
what is the difference between
fopen and open
fread and read
fwrite and write
open and create
why this much of functions for the i/o when everything does the same...?
What is their major difference?
In which case, which is the best to use.
:confused:'ed Collins (2 Replies)
Good evening, I'm trying to do my own shell and I encountered some issues while creating it. Indeed when I try such a command I have
DAUPHINE> DAUPHINE> ls -l | grep terminal > fichier
DAUPHINE> cat fichier
My shell is named DAUPHINE
Whereas I should have:
Code:
... (0 Replies)
I am building a wrapper around fgets, and fighting crashes for no reason I can explain.
I have stripped it down as far as I can and it still crashes.
#include <stdio.h>
#include <stdlib.h>
typedef struct {
char buf;
FILE *fp;
int type;
} wrap;
wrap... (12 Replies)
I have a huge text file, about 52 GB. In the file, there are patterns like these:
]
]
]
]One can see that there is text within patterns such as and ], and I am only interested in ]. There is text before and after all these patterns too, for example,
''Anarchism''' is a ] that advocates ]... (3 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 an array, that works well. But, I want to have it display every other line. Like so, 1, 3, 5, 7, etc, etc.
Here is the relevant code:
I'm sorry for the pastebin link. For some reason, I can't get the code to format properly with the code tags.
code tags work fine... everyone... (4 Replies)