I am a beginner in C and I'm facing this error in Xcode when I'm writing my C code. I've seen the other questions here on StackOverflow but it doesn't seem to solve my problem. I think it has something to do with linking libraries but I'm not sure how to do that.
This is my code below:
#include<stdio.h>
#include<stdlib.h>
void add_task(void);
void view_task(void);
void manage_task(void);
int main()
{
char main_choice;
system("cls");
printf("Welcome to your Task Management Sytem\n");
printf("What would you like to do today?\n A: Add New Task\n B: View Task \n C: Manage Tasks\n");
printf("\nEnter your choice:");
scanf("%c", &main_choice);
add_task();
view_task();
manage_task();
switch(main_choice)
{
case 'A':
{
printf("\n--------------ADD A NEW TASK-------------");
add_task();
break;
}
case 'B':
{
printf("\n--------------VIEW A TASK-------------");
view_task();
break;
}
case 'C':
{
printf("\n--------------MANAGE TASKS-------------");
manage_task();
break;
}
default:
printf("INVALID INPUT");
break;
}
}
void add_task()
{
char name[20];
char category[20];
char info[20];
char date[20];
char status[20];
printf("\nTo Add a new task enter the details below\n");
printf("Name of Task:");
scanf(" %s", name);
printf("Category of Task:");
scanf(" %s", category);
printf("Information about task:");
scanf(" %s", info);
printf("Due Date of Task(dd/mm/yyyy):");
scanf(" %s", date);
printf("Status of Task\n TD = To-Do\n IP = In Progress\n CT = Completed Task\nEnter Status:");
scanf(" %s", status);
}
void view_task()
{
char task_choice;
printf("View Tasks by:\nA:Due Date\nB:Category\nC:Status\nD:View All Tasks");
scanf(" %c", &task_choice);
if (task_choice == 'A')
{
char date_choice;
printf("A:View Tasks in ascending order\nB: View Tasks in descending order\nEnter your choice:");
scanf(" %c", &date_choice);
}
}
void manage_task()
{
printf("What do you want to change");
}
.........................................................................................