Search code examples
cmallocfgets

fgets malloc c help


if i have a variable from fgets

for example fgets(question,200,stdin); how do i determine the size of the variable question without all the trailing blank elemets?


Solution

  • Use strlen(3). Was there a question about malloc(3) too?