Advertisement
thenewboston

C Programming Tutorial - 49 - Structures (pt. 2)

Aug 22nd, 2014
429
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.53 KB | None | 0 0
  1. // main.c
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include "BuckysInfo.h"
  5.  
  6. int main()
  7. {
  8.     //really good with storing many users and displaying all data at once
  9.     struct user person1;
  10.     struct user person2;
  11.  
  12.     person1.userID = 290;
  13.     person2.userID = 291;
  14.  
  15.     puts("Enter the name of user 1");
  16.     gets(person1.firstName);
  17.     puts("Enter the name of user 2");
  18.     gets(person2.firstName);
  19.  
  20.     printf("User 1 id is %d\n", person1.userID);
  21.     printf("User 2 name is %s\n", person2.firstName);
  22.  
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement