I try to store a sentences in key.programme using fgets but it never work. It just scan the first word just like a scanf. It dont scan a whitespace. Please help. TY
Code:#include <stdio.h> #include <stdlib.h> struct record{ char* name; char* programme; int id; float cgpa; }; typedef struct record record; int main(){ record key; printf("Programme:"); fflush(stdin); fgets(key.programme, sizeof(key.programme),stdin); printf("Input received: %s", key.programme); }