[packagekit] C dude needed

Matthias Clasen matthias.clasen at gmail.com
Wed Feb 20 15:47:35 PST 2008


On Wed, Feb 20, 2008 at 6:46 PM, Matthias Clasen
<matthias.clasen at gmail.com> wrote:
> On Wed, Feb 20, 2008 at 5:51 PM, Richard Hughes <hughsient at gmail.com> wrote:
>  > On Wed, 2008-02-20 at 23:37 +0100, Adrien BUSTANY wrote:
>  >  > Well, some bare code could be like :
>  >  > #include <stdio.h>
>  >  >
>  >  > int main(int argc, char **argv) {
>  >  >         char answer;
>  >  >         printf("Would you like to plop ? [N/y] ");
>  >  >         scanf("%c", &answer);
>  >  >
>  >  >         switch (answer) {
>  >  >                 case 'y':
>  >  >                         printf("Cool, let's go plopping\n");
>  >  >                         break;
>  >  >                 default:
>  >  >                         printf("Too bad, maybe another time\n");
>  >  >         }
>  >  >         return 0;
>  >  > }
>  >  >
>  >  > of course this could be wrapped into a neat function
>  >
>  >  That'll do nicely, thanks.
>  >
>
>  No need to go all the way to fscanf
>

....getchar should already do nicely, was what I meant to say.



More information about the PackageKit mailing list