Thread: Calling a function from a library by command line arguments

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    May 2020
    Posts
    3

    Calling a function from a library by command line arguments

    Hello everyone,

    I want to do the following in C Language:
    - Program takes 2 arguments by command line arguments: first argument is library name, and second is function name from that library. (I know how to do that)
    -The program then includes the library as
    Code:
    #include <library_name>
    and also calls the function which has a function signature as
    Code:
    double function(double argument)
    . What is a way that could do this task? How to get the library and function to work by getting them from argv[]?
    - Read all double values from input and apply the function to all the values. E.g: sin(0). (Can do that if I know how to get the function by using argv[])


    What I have done is that I tried getting the library include tag as a string and convert it to executable code but apparently it is impossible in C to do such thing.
    Any idea will be highly appreciated! Thanks!
    Last edited by Potato571; 05-12-2020 at 05:12 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 5
    Last Post: 02-05-2020, 12:21 AM
  2. Function to store command line arguments in array
    By Lanuk in forum C Programming
    Replies: 2
    Last Post: 02-02-2015, 12:56 PM
  3. command line arguments
    By tempster09 in forum C Programming
    Replies: 3
    Last Post: 12-06-2009, 06:27 PM
  4. Command line arguments
    By Jasper in forum C Programming
    Replies: 8
    Last Post: 08-07-2009, 10:24 AM
  5. command line arguments
    By belusha in forum C Programming
    Replies: 4
    Last Post: 01-27-2003, 09:35 PM

Tags for this Thread