From cda372243e8e4dbd20d61941fd9e7ac591bfbd1d Mon Sep 17 00:00:00 2001 From: DigitaLogic Date: Tue, 16 Apr 2019 00:34:23 +0300 Subject: [PATCH 1/2] Add files via upload --- Joshua_Jones_buggy.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 Joshua_Jones_buggy.c diff --git a/Joshua_Jones_buggy.c b/Joshua_Jones_buggy.c new file mode 100644 index 0000000..b46c186 --- /dev/null +++ b/Joshua_Jones_buggy.c @@ -0,0 +1,37 @@ +#include +#include + +/* Assignment: +1. fix bugs in the code +2. add comments +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 +{ + int age; + char name[10]; //removed = sign +}; + + +void main() +{ + struct dog thing1; //removed parentheses and replaced colon + struct dog thing2; + + thing1.age = 5; //removed bracket + thing2.age = 13; + + puts{"What is your dogs name? "}; + gets(thing1.name); removed 's' from names + + strcpy(thing2.name, "Buster"); + + printf("Name: %s\n",thing1.name );//replaced 'i' + printf("Age: %i\n",thing1.age): + printf("Thing2 Name: %s\n",thing2.name); //closed quote + printf("Thing2 Age %i\n",thing2.age); //closed quote +} \ No newline at end of file From e5190a8b20c08a766164a397c7c99da543bd37c5 Mon Sep 17 00:00:00 2001 From: DigitaLogic Date: Tue, 16 Apr 2019 00:39:24 +0300 Subject: [PATCH 2/2] Update Joshua_Jones_buggy.c --- Joshua_Jones_buggy.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Joshua_Jones_buggy.c b/Joshua_Jones_buggy.c index b46c186..d0533f2 100644 --- a/Joshua_Jones_buggy.c +++ b/Joshua_Jones_buggy.c @@ -34,4 +34,6 @@ void main() printf("Age: %i\n",thing1.age): printf("Thing2 Name: %s\n",thing2.name); //closed quote printf("Thing2 Age %i\n",thing2.age); //closed quote -} \ No newline at end of file + + return 0; +}