Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7054425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:37:30+00:00 2026-05-28T03:37:30+00:00

I am trying to find a way to use FILE * fopen ( const

  • 0

I am trying to find a way to use
FILE * fopen ( const char * filename, const char * mode ); but passing the filename indirectly. i would also like to know how to indirectly call a function with name taken straightly from argv[].I dont want to store the string in a buffer char array. For example:

 int main (int argc,char *argv[])
    {
      FILE *src;
      ...
      src = fopen("argv[1]", "r");   //1st:how to insert the name of the argv[1] for example?
      ...
     function_call(argc,argv);    //2nd:and also how to call a function using directly argc argv
     ...
     }
    void create_files(char name_file1[],char name_file2[])
    {...}

Do i have to store length and the string of chars in order to call a function? (regarding the 2nd question) 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T03:37:31+00:00Added an answer on May 28, 2026 at 3:37 am

    You can simply use argv[1], it’s a char *:

    if (argc < 2)
        /* Error. */
    
    src = fopen(argv[1], "r");
    

    Same goes for create_files.

    create_files(argv[1], argv[2]);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to find the best way to use Java libraries that were installed
I'm having trouble trying to find the right way to use MSBuild to build
I'm trying to find a good way to get a Scanner to use a
I'm trying to find a way to use Perl to further process a PostgreSQL
I'm trying to find an optimal way to use the latest Spring 3.0. I
We're converting our Selenium tests to use Selenium-Grid. I'm trying to find a way
I'm trying to use a BufferedInputStream to load an external DICOM file, but it
I'm trying to find a way to read in a WSDL file (I will
I'm trying to find a way to inject FDF file content into a fillable
I'm trying to find a way of being able to use multiple versions of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.