Hello ,
I write a program that require the users to enter their password. How to do it?
According to a book of K&R, "When a program begins execution, three stream stdin,
stdout, stderr are already open". But how to get pointers to these stream?
Faithfully yours,
Try. 2 1525
In article <7f*************************@posting.google.com> ,
Try Kret <kr*****@kh.refer.org> wrote: Hello ,
I write a program that require the users to enter their password. How to do it? According to a book of K&R, "When a program begins execution, three stream stdin, stdout, stderr are already open". But how to get pointers to these stream?
stdin, stdout, and stderr *are* file pointers to the standard input,
standard output, and standard error streams. Try reading up on functions
such as getchar, fgets, etc.
-Tim Miller
Tim Miller wrote: In article <7f*************************@posting.google.com> , Try Kret <kr*****@kh.refer.org> wrote:
Hello ,
I write a program that require the users to enter their password. How to do it? According to a book of K&R, "When a program begins execution, three stream stdin, stdout, stderr are already open". But how to get pointers to these stream?
stdin, stdout, and stderr *are* file pointers to the standard input, standard output, and standard error streams.
But you do have to #include <stdio.h> in order to get the declarations
for them.
-Kevin
--
My email address is valid, but changes periodically.
To contact me please use the address from a recent posting. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Richard |
last post by:
Hi,
Can anyone tell me what the difference is between
for line in file.readlines( ):
and
for line in file:
|
by: Mike |
last post by:
I would like my 'print' statements to send its output to the user's
screen and a log file.
This is my initial attempt:
class StdoutLog(file):
def __init__(self, stdout,...
|
by: hpy_awad |
last post by:
I am writing stings ((*cust).name),((*cust).address)to a file using
fgets but rabish is being wrote to that file ? Look to my source
please and help me finding the reason why this rabish is being...
|
by: Carramba |
last post by:
#include <stdio.h>
int main( void ){
char cQuit = 'a';
char cKommando , artistNamn , skivansNamn , cChar;
int cK ;
FILE *pekaFile;
printf( "l - for read file\n");
printf( "s - for writte...
|
by: pank7 |
last post by:
hi everyone,
I have a program here to test the file IO(actually output) with buffer
turned on and off. What I want to see is that there will be obvious
differece in time. Here I have an input...
|
by: siliconwafer |
last post by:
Hi All,
I want to know tht how can one Stop reading a file in C (e.g a Hex
file)with no 'EOF'?
|
by: MisterPete |
last post by:
How can I inherit from file but stil create an instance that writes to
stdout?
-----------
I'm writing a file-like object that has verbosity options (among
some other things). I know I could just...
|
by: =?gb2312?B?yMvR1MLkyNXKx8zs0cSjrM37vKvM7NHEsru8+7z |
last post by:
I wanna print the log to both the screen and file, so I simulatered a
'tee'
class Tee(file):
def __init__(self, name, mode):
file.__init__(self, name, mode)
self.stdout = sys.stdout...
|
by: TP |
last post by:
Hi everybody,
The following code does not redirect the output of os.system("ls") in a
file:
import sys, os
saveout = sys.stdout
fd = open( 'toto', 'w' )
sys.stdout = fd
os.system( "ls" )
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |