Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C > Re: An interest...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 5 of 8 Topic 26065 of 26972
Post > Topic >>

Re: An interesting c program for beginners

by Niz <niz@[EMAIL PROTECTED] > May 5, 2008 at 01:18 PM

On 2008-05-05 12:23:26 +0100, apaticul@[EMAIL PROTECTED]
 said:
> 
>   printf("First name: ");
>   gets(first);
>   printf("Last Name: ");
>   gets(last);
>   printf("Age: ");
>   scanf("%d", age);
>   printf("Social security number (no hyphens, just 3 figures): ");
>   scanf("%d", ssn);
>   printf("Salary: ");
>   scanf("%f", salary);

Use fgets() instead of gets() it is much safer.
 




 8 Posts in Topic:
An interesting c program for beginners
apaticul@[EMAIL PROTECTED  2008-05-04 23:45:50 
Re: An interesting c program for beginners
Richard Heathfield <rj  2008-05-05 07:48:07 
Re: An interesting c program for beginners
"Malcolm McLean"  2008-05-05 09:26:35 
Re: An interesting c program for beginners
apaticul@[EMAIL PROTECTED  2008-05-05 04:23:26 
Re: An interesting c program for beginners
Niz <niz@[EMAIL PROTEC  2008-05-05 13:18:22 
Re: An interesting c program for beginners
"Bill Leary" &l  2008-05-05 10:25:32 
Re: An interesting c program for beginners
William Pursell <bill.  2008-05-05 13:15:45 
Re: An interesting c program for beginners
Nick Keighley <nick_ke  2008-05-06 03:58:19 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 16:00:54 CDT 2008.