Home
Blogs
Questions

Home

About Us

Blogs

Questions

Monetize

Post Job

banner

Questions about fputs

Read more about fputs

python (12.9k questions)

javascript (9.2k questions)

reactjs (4.7k questions)

java (4.2k questions)

java (4.2k questions)

c# (3.5k questions)

c# (3.5k questions)

html (3.3k questions)

Questions - fputs

fgets() works wrong in for loop

I am trying to use fgets and fputs to copy-paste a file. I wrote in two ways, one in for loop, the other in while loop. While loop works perfectly, but for loop acts weird. I tried to debug and wrote ...
test-img

kowalski

c

char

newline

fgets

fputs

Votes: 0

Answers: 2

Latest Answer

Actually the input file contains abcde\n fghij\n klmno\n pqrst\n uvwxy\n z\n As the length of the dynamically allocated array is equal to 6 then the first call of fgets reads only 5 characters "...
test-img

Vlad from Moscow

Posts

Questions

Blogs

Where knowledge meets opportunity!

About

  • Company
  • Monetize your knowledge
  • Support

  • Platform

  • Terms & Conditions
  • Privacy statement
  • Cookie policy
  • Cookie option
  • OnlyCoders © 2025  |  All rights reserved