Getting user input in Linux?



Hi,

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.

I currently have:

int* s1;

printf("Enter first integer: %d\n",s1);
scanf(&s1);

When I run this it automatically enters 0. It never pauses and thus
does not allow me to type in a value.

Zach
.



Relevant Pages

  • Re: Getting user input in Linux?
    ... I run Linux 2.6.18 and am seeking a way in C to get user input. ... them to have the chance to enter a value and have it assigned to a ...
    (comp.lang.c)
  • Getting user input in Linux?
    ... I run Linux 2.6.18 and am seeking a way in C to get user input. ... them to have the chance to enter a value and have it assigned to a ...
    (comp.unix.programmer)
  • Re: Has Ubuntu Replaced Windows on Your Box?
    ... -I wasted too many months giving Ubuntu a chance, ... Too many repos, too much crap in those repos, too many steps to do one ... WE DONT NEED TO PROGRAM A COMPUTER FOR EVERYDAY USE, ... Until you linux 'scientists' get that into your heads, ...
    (Ubuntu)
  • Re: Suse Druckerinstallation HP klappt nicht
    ... Ich habe keine Chance den Drucker unter Linux zu betreiben. ... Research is what I'm doing, when I don't know what I'm doing. ...
    (alt.os.linux.suse)
  • Re: RT patch acceptance
    ... Most of the commercial RTOS I happen to use at work can't ... Same for Linux with PREEMPT_RT: The basis system is hard RT (even better ... priority inheritance mechanism). ... With a nanokernel the chance of somebody lifting a subsystem into the ...
    (Linux-Kernel)