Code:
// this is comandom.c
#include <stdio.h> /* para funcoes como printf, scanf, etc */
#include <stdlib.h> /* para a funcao exit */
#include <string.h> /* para funcoes relacionadas com strings */
#include "progmail.h"
void comandom(MAIL *ptr)
{
printf("From: \n"); fgets(ptr->from,sizeof ptr->from, stdin);
printf("To: \n"); fgets(ptr->to,sizeof ptr->to, stdin);
printf("Subject:\n"); fgets(ptr->sub,sizeof ptr->sub, stdin);
printf("Message:\n"); fgets(ptr->msg,sizeof ptr->msg, stdin);
}
I dunno why but the program isn't asking me to insert the "From"...
when I press "m" the output is:
From:
To:
(insert to)
.---------
it skips the from, and then when I test it with "L" the from is empty...