void saveUsersToCSV(const char* filename, Node* head) {
FILE* file = fopen(filename, "w");
if (file == NULL) {
printf("Failed to open file: %s\n", filename);
return;
}
Node* current = head;
while (current != NULL) {
if (current->user.id != 0) {
fprintf(file, "%d,%s,%s,%s,%s\n", current->user.id, current->user.username, current->user.password, current->user.phone, current->user.email);
}
current = current->next;
}
fclose(file);
printf("User information saved successfully.\n");
}