From b86ddd0260fd8ccb779a4576788913322d714120 Mon Sep 17 00:00:00 2001 From: asbullbear <49660880+asbullbear@users.noreply.github.com> Date: Tue, 30 Apr 2019 22:48:38 -0500 Subject: [PATCH] Add files via upload --- buggy.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/buggy.c b/buggy.c index aae42b1..b278dec 100644 --- a/buggy.c +++ b/buggy.c @@ -13,25 +13,25 @@ struct dog { int age; - char name = [10]; + char name[10]; //changed name = [10] to name[10] }; void main() { - struct (dog) thing1: + struct dog thing1; //removed parentheses from dog and changed the colon to a semicolon struct dog thing2; - thing1.age = [5]; + thing1.age = 5; //removed bracets thing2.age = 13; - puts{"What is your dogs name? "}; - gets(thing1.names); + puts("What is your dogs name? "); //replaced {} with () + gets(thing1.name); //removed s from name(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 %i to %s + printf("Age: %i\n",thing1.age); // replaced colon with semicolon + printf("Thing2 Name: %s\n",thing2.name); //Added "" + printf("Thing2 Age %i\n",thing2.age); //Replaced '' with "" } \ No newline at end of file