Afficher un message
Vieux 31/01/2008, 08h33   #4
Joachim Schmitz
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Getting user input in Linux?

Zach wrote:
> 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;

int s1

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

scanf("%d", &s1);

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


Still far from being perfect and safe, but might get you started

Bye, Jojo


  Réponse avec citation
 
Page generated in 0,09909 seconds with 9 queries