From 60da329c21652503def43a97346c42547c344a44 Mon Sep 17 00:00:00 2001 From: brand-git-dsu Date: Mon, 9 Dec 2019 15:42:03 -0700 Subject: [PATCH] made changes to buggy.c --- README.md | 5 ++--- buggy.c | 22 +++++++++++----------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 14de67e..06d3f1c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ # finallab -This is going to be our final assignment for csc150. We are going to do reviews after this for our Final Exam. - -Have a wonderful Thanksgiving!!! +Made appropriate changes within buggy.c file along with notes of changes +made. Have a wonderful holiday season. diff --git a/buggy.c b/buggy.c index aae42b1..e92fa12 100644 --- a/buggy.c +++ b/buggy.c @@ -13,25 +13,25 @@ struct dog { int age; - char name = [10]; -}; + char name [10]; //removed equal sign between name and char length +}; void main() { - struct (dog) thing1: - struct dog thing2; + struct dog thing1; //removed parenthesis around dog and changed colon to a semicolon + struct dog thing2; - thing1.age = [5]; + thing1.age = 5; //removed brackets around the number 5 thing2.age = 13; - puts{"What is your dogs name? "}; - gets(thing1.names); + puts("What is your dogs name? "); //changed braces to parenthesis + gets(thing1.name); //deleted the s after name strcpy(thing2.name, "Buster"); - printf("Name: %i\n",thing1.name ); - printf("Age: %i\n",thing1.age): - printf("Thing2 Name: %s\n,thing2.name); - printf("Thing2 Age %i\n',thing2.age); + printf("Name: %s\n",thing1.name ); //changed %i to %s + printf("Age: %i\n",thing1.age); //changed colon to a semicolon + printf("Thing2 Name: %s\n",thing2.name); //added quotation mark after \n + printf("Thing2 Age %i\n",thing2.age); //changed apostrophe to quotation mark } \ No newline at end of file