LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-22-2010, 03:07 PM   #1
manascetatbbsr
LQ Newbie
 
Registered: Oct 2010
Posts: 1

Rep: Reputation: 0
fgets() function in fedora10 not taking any i/p in aloop


fgets() function does not work inside any loop or any function outside the main function in a c programe.i have debugged the programe using gdb and found that the the string conatins '\n' all times after execution for the first time.
is ther not any functions that takes string as input including blanc space.
 
Old 10-22-2010, 06:25 PM   #2
rupertwh
Member
 
Registered: Sep 2006
Location: Munich, Germany
Distribution: Debian / Ubuntu
Posts: 297

Rep: Reputation: 49
Quote:
Originally Posted by manascetatbbsr View Post
fgets() function does not work inside any loop or any function outside the main function in a c programe.
Of course it does. fgets() doesn't know or care if it is inside a loop.

Quote:
Originally Posted by manascetatbbsr View Post
i have debugged the programe using gdb and found that the the string conatins '\n' all times after execution for the first time.
What program? Do you check the return value? Maybe you *are* reading emtpy lines?

Quote:
Originally Posted by manascetatbbsr View Post
is ther not any functions that takes string as input including blanc space.
Huh? fgets() reads from a file. There is no input string.
 
  


Reply

Tags
aloop, fedora10, fgets, function, i or p, taking



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
kill thread which is with block function... (fgets...) okeyla Programming 2 10-14-2009 07:32 PM
Dual Boot Fedora10/WindowsXP (Fedora10 installed first) jalf86 Fedora 8 12-26-2008 03:40 PM
JavaScript: function only taking constants, no variables. :/ RHLinuxGUY Programming 8 01-19-2007 02:49 AM
ALSA snd-aloop.ko driver (loopback) and /dev/dsp raskin Linux - Software 0 12-20-2005 03:42 AM
fgets vs gets cxel91a Programming 2 12-01-2003 12:36 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:01 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration