I have this struct for an item in a to-do list

struct Task {
	char description[TASK_DESC_SIZE];  	/* description of the task */
	int priority;			  			/* task priority */  
};

i'm just not sure how to alter the description while making a task using this

TYPE createTask (int priority, char *desc) 
{
	struct Task* t = (struct Task*)malloc(sizeof(struct Task));
	t->description = *desc;
	t->priority = priority;
	return *t;
}

I would love to know how to change the description.

nevermind. I fixed it with this

TYPE createTask (int priority, char *desc) 
{
	struct Task* t = (struct Task*)malloc(sizeof(struct Task));
	strcpy(t->description, desc);
	return *t;
	
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.