Re: Getting user input in Linux?
- From: Ben Bacarisse <ben.usenet@xxxxxxxxx>
- Date: Thu, 31 Jan 2008 13:32:43 +0000
[Please don't top post and snip content and sigs where possible.]
Manik <manik.mayur@xxxxxxxxx> writes:
<snip>Zach wrote:
I run Linux 2.6.18 and am seeking a way in C to get user input. I want
them to have the chance to enter a value and have it assigned to a
variable.
How about,
int s1;
printf("Enter first integer:");
scanf(&s1);
Won't compile (if you are lucky). Better:
int s1;
printf("Enter first integer: ");
fflush(stdout);
scanf("%d", &s1); /* scanf needs a format */
--
Ben.
.
- References:
- Getting user input in Linux?
- From: Zach
- Re: Getting user input in Linux?
- From: Logan Shaw
- Re: Getting user input in Linux?
- From: Manik
- Getting user input in Linux?
- Prev by Date: true singleton among shared objects
- Next by Date: Re: equiv of .ppt slide
- Previous by thread: Re: Getting user input in Linux?
- Next by thread: looking for open source software written in C/C++
- Index(es):
Relevant Pages
|
|