diff --git a/buggy.c b/buggy.c index aae42b1..65ad09d 100644 --- a/buggy.c +++ b/buggy.c @@ -13,25 +13,25 @@ struct dog { int age; - char name = [10]; + char name[10]; //fixed declaration, removed "=", 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