I'm trying to input strings in my C structure but it says "warning: implicit declaration of function ‘gets’ [-Wimplicit-function-declaration]" I used to code in Dev-c ++ and I'm practicing at GCC does anyone can help me how to do it.
here is my code: payroll.c
#include<stdio.h>
#include"payroll.h"
void readName(p payroll[], int size){
fgets("%s",&payroll[size].name.first);
}
and in my payroll.h
struct namerec{
char first[15];
char middle[15];
char last[15];
};
typedef struct payrecord{
int id;
struct namerec name;
float hours,rate;
float regular,overtime;
float gross, tax_whh, net;
}p;
void readName(p payroll[], int size);
void printName(p payroll[], int size);
void printSummary(double gross, double tax);
void readRecord(p payroll[], int n);
void printRecord(p payroll[], int n);
double calcRecords(p payroll[], int n,double *taxptr);