From c5cc773e75dab16978eb959b7914a6a868cc3619 Mon Sep 17 00:00:00 2001 From: joshuaFrederico Date: Mon, 15 Apr 2019 06:29:10 -0600 Subject: [PATCH 1/3] Joshua Frederico... --- buggy.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/buggy.c b/buggy.c index aae42b1..9a1ae38 100644 --- a/buggy.c +++ b/buggy.c @@ -3,7 +3,7 @@ /* Assignment: 1. fix bugs in the code -2. add comments +2. add comments (I wasn't sure what comments you had in mind, so I just explained the changes I made...) 3. create a new branch on git 4. git push changed buggy.c 5. create pull request with your name and changes you made @@ -13,25 +13,25 @@ struct dog { int age; - char name = [10]; + char name[10]; // Changed from improper var declaration 'char name = [10];' }; -void main() +int main() // Changed return type from 'void' to 'int'...for some reason my compiler has never liked 'void'... { - struct (dog) thing1: + struct dog thing1; // Replaced ':' with ';', replaced '(dog)' with 'dog' struct dog thing2; - thing1.age = [5]; + thing1.age = 5; // Removed brackets from around property value thing2.age = 13; - puts{"What is your dogs name? "}; - gets(thing1.names); + puts("What is your dogs name? "); // Replaced curly braces with parentheses + gets(thing1.name); // Replaced 'names' with '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 ); // Replaced wrong data type 'i' with 's' + printf("Age: %i\n",thing1.age); // Changed : to ; + printf("Thing2 Name: %s\n" ,thing2.name); // Added missing end quote + printf("Thing2 Age %i\n",thing2.age); // Added missing end quote } \ No newline at end of file From 5eab2f76ad264e1955b592c40a4b849c1c627cf1 Mon Sep 17 00:00:00 2001 From: joshuaFrederico Date: Mon, 15 Apr 2019 06:36:52 -0600 Subject: [PATCH 2/3] github said my version was identical to the original...so I'm trying again like I usually have to... --- buggy.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/buggy.c b/buggy.c index 9a1ae38..00da322 100644 --- a/buggy.c +++ b/buggy.c @@ -3,16 +3,16 @@ /* Assignment: 1. fix bugs in the code -2. add comments (I wasn't sure what comments you had in mind, so I just explained the changes I made...) +2. add comments (I wasn't sure what comments you had in mind, so I just explained the changes I made, or explained the code if no changes were necessary...) 3. create a new branch on git 4. git push changed buggy.c 5. create pull request with your name and changes you made */ -struct dog +struct dog // create new struct called 'dog' { - int age; + int age; // initialize integer variable char name[10]; // Changed from improper var declaration 'char name = [10];' }; @@ -20,15 +20,15 @@ struct dog int main() // Changed return type from 'void' to 'int'...for some reason my compiler has never liked 'void'... { struct dog thing1; // Replaced ':' with ';', replaced '(dog)' with 'dog' - struct dog thing2; + struct dog thing2; // create instance of 'dog' struct called 'thing2' thing1.age = 5; // Removed brackets from around property value - thing2.age = 13; + thing2.age = 13; // assign age property of thing2 to 13 puts("What is your dogs name? "); // Replaced curly braces with parentheses gets(thing1.name); // Replaced 'names' with 'name' - strcpy(thing2.name, "Buster"); + strcpy(thing2.name, "Buster"); // Assign string "Buster" to name property of thing2 using strcpy() printf("Name: %s\n",thing1.name ); // Replaced wrong data type 'i' with 's' printf("Age: %i\n",thing1.age); // Changed : to ; From 2adac8ce29debfafce0ae3a27c05ad2c39608a7d Mon Sep 17 00:00:00 2001 From: joshuaFrederico Date: Mon, 15 Apr 2019 06:42:39 -0600 Subject: [PATCH 3/3] Joshua Frederico...hopefully one last time... --- buggy.c | 1 + 1 file changed, 1 insertion(+) diff --git a/buggy.c b/buggy.c index 00da322..a6b7b14 100644 --- a/buggy.c +++ b/buggy.c @@ -8,6 +8,7 @@ 4. git push changed buggy.c 5. create pull request with your name and changes you made + */ struct dog // create new struct called 'dog'