From 398b27574491134905037aa7df43a32139b4f46c Mon Sep 17 00:00:00 2001 From: Matt Date: Tue, 3 Dec 2019 21:12:42 -0700 Subject: [PATCH 1/2] Matthew Pittman - Final Lab --- buggy.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/buggy.c b/buggy.c index aae42b1..3e77b63 100644 --- a/buggy.c +++ b/buggy.c @@ -13,25 +13,25 @@ struct dog { int age; - char name = [10]; + char name[10]; //fixed declaration, removed "=" and space }; void main() { - struct (dog) thing1: + struct dog thing1; //changed colon to semicolon, removed parentheses struct dog thing2; - thing1.age = [5]; + thing1.age = 5; //removed brackets thing2.age = 13; - puts{"What is your dogs name? "}; - gets(thing1.names); + puts("What is your dogs name? "); + gets(thing1.name); //removed "s" 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 variable type from i to s, removed space + printf("Age: %i\n",thing1.age); //changed colon to semicolon + printf("Thing2 Name: %s\n",thing2.name); //Missing quotation mark + printf("Thing2 Age %i\n",thing2.age); //Replaced single quote with double } \ No newline at end of file From 45b4fd81a83e475fb3db6b0f5ffc899d281be986 Mon Sep 17 00:00:00 2001 From: Matt Date: Sun, 8 Dec 2019 15:27:17 -0700 Subject: [PATCH 2/2] line 16 - fixed declaration, removed = , space 22 - changed colon to semicolon, removed parentheses 25 - removed brackets 29 - removed "s" character 33 - changed variable type from i to s, removed space 34 - changed colon to semicolon 35 - added missing quotation mark 36 - Replaced single quote with double --- buggy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buggy.c b/buggy.c index 3e77b63..65ad09d 100644 --- a/buggy.c +++ b/buggy.c @@ -13,7 +13,7 @@ struct dog { int age; - char name[10]; //fixed declaration, removed "=" and space + char name[10]; //fixed declaration, removed "=", space };