From 72421e4f56814e903af86b665b04ca897fcc5ff1 Mon Sep 17 00:00:00 2001 From: patrickdsu Date: Tue, 16 Apr 2019 17:39:26 -0500 Subject: [PATCH] made changes to buggy.c --- buggy.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/buggy.c b/buggy.c index aae42b1..179e1e5 100644 --- a/buggy.c +++ b/buggy.c @@ -13,25 +13,25 @@ struct dog { int age; - char name = [10]; + char name[10]; //took out the equal sign }; void main() { - struct (dog) thing1: + struct dog thing1; // added semicolin and took dog out of parenthesis struct dog thing2; - thing1.age = [5]; + thing1.age = 5; // took 5 out of brackets thing2.age = 13; - puts{"What is your dogs name? "}; - gets(thing1.names); + puts("What is your dogs name? "); //replaced braces with parenthesis + gets(thing1.name); //took s off the end of 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 colin to a semicolin + printf("Thing2 Name: %s\n",thing2.name); //added quotation mark at end + printf("Thing2 Age: %i\n",thing2.age); //changed apostrophe to quotation mark } \ No newline at end of file