#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    1
    Rep Power
    0

    How to convert this program in c?


    help me please convert this program in C from C++.

    Code:
    ifstream f("sah");
     f>>n>>m;
     for(i=1;i<=m;i++)     
    f>>px[i]>>py[i];
     f>>iz>>jz; } 
    
     .........................
    
    cout<<setw(3)<<sol[i][j]; 
    cout<<endl;} 
    cout<<endl; }  
    
    
    }
  2. #2
  3. Contributed User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jun 2005
    Posts
    4,379
    Rep Power
    1871
    > ifstream f("sah");
    This you replace with fopen

    > f>>n>>m;
    Anything f>> you replace with fscanf

    > cout<<setw(3)<<sol[i][j];
    Anything cout << you replace with printf

    All you need is a bit of effort to read those manual pages to discover the detail.

    The rest works the same in both languages.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper

IMN logo majestic logo threadwatch logo seochat tools logo