Information

Author(s) Sébastien Quatresooz Anthony Doeraene
Deadline No deadline
Submission limit No limitation

Tags

Sign in

Decode message

You have to write a function called filter which will return the message contained in a list of nodes. Each node contains a character (usefull or not), you must concatenate these characters and return the corresponding phrase . You have to ignore the all characters, excepts letters and spaces.

/**
* Structure node
*
* @next: pointer to the following node of the list, NULL if last node
* @value: value contained in the node
*/

typedef struct node{
  struct node* next;
  char value;
} node_t;

Example of use :

  • list of nodes : {'h', 'e', '\\', 'l', 'l', ';', '&', 'o', ' '} returns "hello "
  • list of nodes : NULL returns NULL

Decode
/*
 *@pre n can be NULL
 *@pre size_mess : size of the unfiltered message
 *@post return the filtered message, NULL if the list is empty or if an error occurred
 */
char* filter(node_t* node, unsigned int size_mess);