FILE *fp;
 int x ;
 fp = fopen( "c:\\test.txt","r+");
 // fscanf(fp,"% d",&x);
 do
 { 
  char str[50];
  for(int i=0;;i++)
  {
   x = fgetc(fp);
   if(x != ' ' && x!=EOF)
    str[i] = x;
   else
   {
    str[i] = '\0';
    break;
   }   
  }  
 printf("%s", str);
   }while(x!=EOF);


umkatakam <[EMAIL PROTECTED]> wrote:
          --- In [email protected], "Tamas Marki" <[EMAIL PROTECTED]> 
wrote:
>
> On 3/16/07, uma mahesh katakam <[EMAIL PROTECTED]> wrote:
> > its like i am working on a code written in c ... so i need da 
logic in c only i tried using getw and fscanf .. but :( dint 
work ....
> 
> Why don't you show us the code?
> 
> -- 
> Tamas Marki
>
#include<stdio.h>
#include<conio.h>
void main()
{
FILE *fp;

int x ;
fp = fopen( "even.txt","r+");
// fscanf(fp,"%d",&x);
do
{
x = getw(fp);
printf("%d",x);

}while(x!=EOF)

getch();

}

this is da code .... it aint retuning me the actual inegers ... my 
even.txt file has a few integers in order for ex : 1 2 3 4 5



         


Amit D. Petkar
Member Of Techinical Staff      
Persistent Systems Pvt. Ltd. 
'Bhageerath', 402,
Senapati Bapat Road, 
Pune- 411 016. INDIA.
 [EMAIL PROTECTED] 
 tel  : +91 (20)25602749
 fax  : +91 (20) 25678901
 mobile: +91 9822345538
                                
---------------------------------
 Here’s a new way to find what you're looking for - Yahoo! Answers 

[Non-text portions of this message have been removed]

Reply via email to