Please ignore the last post

Fetch a character.
if isdigit( current_character )
     add it to temp string
     flag =1
else if current_character is any character except space
     flag = 0
       while current_char  is not space
          current_char_position ++
else if current_char is space and flag = 1
       fetch last word (temp string)

On Wed, Jul 4, 2012 at 10:51 PM, Abhishek Sharma <abhi120...@gmail.com>wrote:

> Fetch a character.
> if isdigit( current_character )
>       flag =1
> else if current_character is any character except space
>
>  while current_char  is not space
>           current_char_position ++
>
>
> On Wed, Jul 4, 2012 at 10:44 PM, Navin Kumar <algorithm.i...@gmail.com>wrote:
>
>> Suppose a file.txt contains : 50 40 30 # # 5 # 10 # #
>>
>> i want to fetch only integers. How should i fetch it. I tried with fgetc
>> and fscanf but it was too complicated.
>>
>> My approach: fetched one word at a time and put it into separate string
>> and then i converted that string to integer(if each character of that
>> string was between '0' to '9').
>>
>> Is there any simple way to do this.
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/algogeeks/-/btvudXnBrAIJ.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> Abhishek Sharma
> Under-Graduate Student,
> PEC University of Technology
>
>


-- 
Abhishek Sharma
Under-Graduate Student,
PEC University of Technology

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to